@ngockhoale/ukit 3.0.0 → 3.0.2

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 (445) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/manifests/documentation.yaml +75 -64
  3. package/manifests/engineConformance.yaml +32 -0
  4. package/manifests/hostCapabilities.yaml +2 -2
  5. package/manifests/instructionRules.yaml +55 -55
  6. package/manifests/platform.full.yaml +30 -4
  7. package/manifests/platform.user.yaml +4 -4
  8. package/package.json +8 -7
  9. package/scripts/bench/v3-ceremony.mjs +214 -0
  10. package/scripts/install/sync-installed-mirror.mjs +3 -3
  11. package/scripts/perf/audit-perf.mjs +9 -9
  12. package/scripts/perf/perf-findings.json +4 -4
  13. package/scripts/perf/perf-measure.md +20 -20
  14. package/src/cli/commands/doctor.js +38 -2
  15. package/src/core/buildPlan.js +3 -3
  16. package/src/core/compact/contextBudget.js +2 -2
  17. package/src/core/compact/threshold.js +3 -3
  18. package/src/core/docContracts.js +17 -17
  19. package/src/core/ensureGitignore.js +1 -1
  20. package/src/core/executionContracts.js +42 -2
  21. package/src/core/fileOps.js +3 -3
  22. package/src/core/gatewayProbe.js +2 -2
  23. package/src/core/gatewayResilienceEnv.js +2 -2
  24. package/src/core/handoffDocValidator.js +152 -0
  25. package/src/core/output/index.js +1 -1
  26. package/src/core/paths.js +2 -1
  27. package/src/core/reviewPanelAggregate.js +120 -0
  28. package/src/core/runInstallPipeline.js +6 -4
  29. package/src/core/runtimeConfig.js +13 -6
  30. package/src/core/sensitiveValueScanner.js +1 -1
  31. package/src/core/taskBudgetValidator.js +1 -1
  32. package/src/core/unattendedDoctor.js +1 -1
  33. package/src/core/update.js +1 -1
  34. package/src/index/buildIndex.js +2 -2
  35. package/src/index/impactCatalog.js +12 -12
  36. package/src/index/taskRouting.js +263 -5
  37. package/src/render/instructionRenderer.js +7 -7
  38. package/src/skill/auditSkill.js +1 -1
  39. package/{templates → template_project}/.claude/agents/code-reviewer.md +25 -0
  40. package/{templates → template_project}/.claude/agents/handoff-planner.md +17 -2
  41. package/{templates → template_project}/.claude/commands/ukit/handoff-create.md +1 -1
  42. package/{templates → template_project}/.claude/commands/ukit/handoff-fullstack.md +26 -6
  43. package/{templates → template_project}/.claude/commands/ukit/handoff-review.md +31 -6
  44. package/{templates → template_project}/.claude/hooks/handoff-model-guard.sh +1 -1
  45. package/{templates → template_project}/.claude/hooks/skill-router.sh +3 -3
  46. package/{templates → template_project}/.claude/skills/skill-quality/SKILL.md +1 -1
  47. package/{templates → template_project}/.claude/skills/skill-quality/pressure-scenario-template.md +1 -1
  48. package/template_project/.claude/ukit/index/handoff-doc-validator.mjs +193 -0
  49. package/{templates → template_project}/.claude/ukit/index/lib/index-core.mjs +12 -12
  50. package/template_project/.claude/ukit/index/review-panel-aggregate.mjs +174 -0
  51. package/{templates → template_project}/.claude/ukit/index/route-task.mjs +408 -12
  52. package/{templates → template_project}/.claude/ukit/index/unic-gateway.mjs +1 -1
  53. package/{templates → template_project}/.claude/ukit/runtime/execution-ledger.mjs +14 -5
  54. package/{templates → template_project}/.claude/ukit/runtime/safe-patch-core.mjs +3 -3
  55. package/{templates → template_project}/.claude/ukit/runtime/sensitive-value-scanner.mjs +1 -1
  56. package/{templates → template_project}/.claude/ukit/runtime/stop-coordinator.mjs +187 -8
  57. package/{templates → template_project}/.claude/ukit/runtime/task-watchdog.mjs +1 -1
  58. package/{templates → template_project}/.gitignore +2 -2
  59. package/{templates → template_project}/.omp/RULES.md +1 -1
  60. package/{templates → template_project}/.omp/agents/code-reviewer.md +27 -0
  61. package/{templates → template_project}/.omp/agents/handoff-planner.md +17 -2
  62. package/{templates → template_project}/.omp/config.yml +3 -3
  63. package/{templates → template_project}/AGENTS.md +2 -2
  64. package/{templates → template_project}/CLAUDE.md +2 -2
  65. package/{templates → template_project}/docs/AI_HANDOFF/RULES.md +1 -1
  66. package/{templates → template_project}/docs/UKIT_INTERNALS.md +3 -3
  67. package/{templates → template_project}/instructions/core.md +1 -1
  68. package/{templates → template_project}/instructions/layout.yaml +8 -8
  69. package/{templates → template_project}/instructions/overlays/claude.md +1 -1
  70. package/{templates → template_project}/instructions/overlays/repo.md +1 -1
  71. package/{templates → template_project}/ukit/storage/config.json +4 -1
  72. package/template_project/ukit/storage/memory/projects/.gitkeep +2 -0
  73. package/templates/ukit/storage/memory/projects/.gitkeep +0 -2
  74. /package/{templates → template_project}/.claude/agents/bug-debugger.md +0 -0
  75. /package/{templates → template_project}/.claude/agents/feature-implementer.md +0 -0
  76. /package/{templates → template_project}/.claude/agents/ukit-small-task-maintainer.md +0 -0
  77. /package/{templates → template_project}/.claude/agents/ukit-vision-analyst.md +0 -0
  78. /package/{templates → template_project}/.claude/commands/ukit/handoff-clear.md +0 -0
  79. /package/{templates → template_project}/.claude/commands/ukit/handoff-implement.md +0 -0
  80. /package/{templates → template_project}/.claude/commands/ukit/handoff-status.md +0 -0
  81. /package/{templates → template_project}/.claude/config/providers.md +0 -0
  82. /package/{templates → template_project}/.claude/hooks/auto-allow-bash.sh +0 -0
  83. /package/{templates → template_project}/.claude/hooks/auto-prune-bash.sh +0 -0
  84. /package/{templates → template_project}/.claude/hooks/block-dangerous.mjs +0 -0
  85. /package/{templates → template_project}/.claude/hooks/block-dangerous.sh +0 -0
  86. /package/{templates → template_project}/.claude/hooks/completion-gate.sh +0 -0
  87. /package/{templates → template_project}/.claude/hooks/compress-output.sh +0 -0
  88. /package/{templates → template_project}/.claude/hooks/context-hardcap-gate.sh +0 -0
  89. /package/{templates → template_project}/.claude/hooks/context-window-guard.sh +0 -0
  90. /package/{templates → template_project}/.claude/hooks/handoff-resume.sh +0 -0
  91. /package/{templates → template_project}/.claude/hooks/post-edit-verify.sh +0 -0
  92. /package/{templates → template_project}/.claude/hooks/pre-edit-backup.sh +0 -0
  93. /package/{templates → template_project}/.claude/hooks/project-important.sh +0 -0
  94. /package/{templates → template_project}/.claude/hooks/protect-files.sh +0 -0
  95. /package/{templates → template_project}/.claude/hooks/record-execution.mjs +0 -0
  96. /package/{templates → template_project}/.claude/hooks/record-execution.sh +0 -0
  97. /package/{templates → template_project}/.claude/hooks/reinject-context.sh +0 -0
  98. /package/{templates → template_project}/.claude/hooks/reset-compact-pressure.sh +0 -0
  99. /package/{templates → template_project}/.claude/hooks/sensitive-data-guard.mjs +0 -0
  100. /package/{templates → template_project}/.claude/hooks/sensitive-data-guard.sh +0 -0
  101. /package/{templates → template_project}/.claude/hooks/session-episode.sh +0 -0
  102. /package/{templates → template_project}/.claude/hooks/session-start.md +0 -0
  103. /package/{templates → template_project}/.claude/hooks/stale-spec-guard.sh +0 -0
  104. /package/{templates → template_project}/.claude/hooks/task-watchdog.sh +0 -0
  105. /package/{templates → template_project}/.claude/hooks/verification-guard.sh +0 -0
  106. /package/{templates → template_project}/.claude/hooks/vision-router.sh +0 -0
  107. /package/{templates → template_project}/.claude/settings.json +0 -0
  108. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +0 -0
  109. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +0 -0
  110. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +0 -0
  111. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +0 -0
  112. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/dml-main.xsd +0 -0
  113. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +0 -0
  114. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +0 -0
  115. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +0 -0
  116. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/pml.xsd +0 -0
  117. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +0 -0
  118. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +0 -0
  119. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +0 -0
  120. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +0 -0
  121. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +0 -0
  122. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +0 -0
  123. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +0 -0
  124. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +0 -0
  125. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/shared-math.xsd +0 -0
  126. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +0 -0
  127. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/sml.xsd +0 -0
  128. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/vml-main.xsd +0 -0
  129. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +0 -0
  130. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +0 -0
  131. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +0 -0
  132. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +0 -0
  133. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/wml.xsd +0 -0
  134. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/ISO-IEC29500-4_2016/xml.xsd +0 -0
  135. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/ecma/fouth-edition/opc-contentTypes.xsd +0 -0
  136. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/ecma/fouth-edition/opc-coreProperties.xsd +0 -0
  137. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/ecma/fouth-edition/opc-digSig.xsd +0 -0
  138. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/ecma/fouth-edition/opc-relationships.xsd +0 -0
  139. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/mce/mc.xsd +0 -0
  140. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/microsoft/wml-2010.xsd +0 -0
  141. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/microsoft/wml-2012.xsd +0 -0
  142. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/microsoft/wml-2018.xsd +0 -0
  143. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/microsoft/wml-cex-2018.xsd +0 -0
  144. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/microsoft/wml-cid-2016.xsd +0 -0
  145. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/microsoft/wml-sdtdatahash-2020.xsd +0 -0
  146. /package/{templates → template_project}/.claude/skills/_shared/ooxml/schemas/microsoft/wml-symex-2015.xsd +0 -0
  147. /package/{templates → template_project}/.claude/skills/_shared/ooxml/scripts/pack.py +0 -0
  148. /package/{templates → template_project}/.claude/skills/_shared/ooxml/scripts/unpack.py +0 -0
  149. /package/{templates → template_project}/.claude/skills/_shared/ooxml/scripts/validate.py +0 -0
  150. /package/{templates → template_project}/.claude/skills/_shared/ooxml/scripts/validation/__init__.py +0 -0
  151. /package/{templates → template_project}/.claude/skills/_shared/ooxml/scripts/validation/base.py +0 -0
  152. /package/{templates → template_project}/.claude/skills/_shared/ooxml/scripts/validation/docx.py +0 -0
  153. /package/{templates → template_project}/.claude/skills/_shared/ooxml/scripts/validation/pptx.py +0 -0
  154. /package/{templates → template_project}/.claude/skills/_shared/ooxml/scripts/validation/redlining.py +0 -0
  155. /package/{templates → template_project}/.claude/skills/backend-api/SKILL.md +0 -0
  156. /package/{templates → template_project}/.claude/skills/canvas-design/LICENSE.txt +0 -0
  157. /package/{templates → template_project}/.claude/skills/canvas-design/SKILL.md +0 -0
  158. /package/{templates → template_project}/.claude/skills/canvas-design/canvas-fonts/BricolageGrotesque-Bold.ttf +0 -0
  159. /package/{templates → template_project}/.claude/skills/canvas-design/canvas-fonts/BricolageGrotesque-OFL.txt +0 -0
  160. /package/{templates → template_project}/.claude/skills/canvas-design/canvas-fonts/BricolageGrotesque-Regular.ttf +0 -0
  161. /package/{templates → template_project}/.claude/skills/canvas-design/canvas-fonts/InstrumentSans-Bold.ttf +0 -0
  162. /package/{templates → template_project}/.claude/skills/canvas-design/canvas-fonts/InstrumentSans-BoldItalic.ttf +0 -0
  163. /package/{templates → template_project}/.claude/skills/canvas-design/canvas-fonts/InstrumentSans-Italic.ttf +0 -0
  164. /package/{templates → template_project}/.claude/skills/canvas-design/canvas-fonts/InstrumentSans-OFL.txt +0 -0
  165. /package/{templates → template_project}/.claude/skills/canvas-design/canvas-fonts/InstrumentSans-Regular.ttf +0 -0
  166. /package/{templates → template_project}/.claude/skills/canvas-design/canvas-fonts/InstrumentSerif-Italic.ttf +0 -0
  167. /package/{templates → template_project}/.claude/skills/canvas-design/canvas-fonts/InstrumentSerif-Regular.ttf +0 -0
  168. /package/{templates → template_project}/.claude/skills/canvas-design/canvas-fonts/JetBrainsMono-Bold.ttf +0 -0
  169. /package/{templates → template_project}/.claude/skills/canvas-design/canvas-fonts/JetBrainsMono-OFL.txt +0 -0
  170. /package/{templates → template_project}/.claude/skills/canvas-design/canvas-fonts/JetBrainsMono-Regular.ttf +0 -0
  171. /package/{templates → template_project}/.claude/skills/canvas-design/canvas-fonts/Lora-Bold.ttf +0 -0
  172. /package/{templates → template_project}/.claude/skills/canvas-design/canvas-fonts/Lora-BoldItalic.ttf +0 -0
  173. /package/{templates → template_project}/.claude/skills/canvas-design/canvas-fonts/Lora-Italic.ttf +0 -0
  174. /package/{templates → template_project}/.claude/skills/canvas-design/canvas-fonts/Lora-OFL.txt +0 -0
  175. /package/{templates → template_project}/.claude/skills/canvas-design/canvas-fonts/Lora-Regular.ttf +0 -0
  176. /package/{templates → template_project}/.claude/skills/canvas-design/canvas-fonts/NothingYouCouldDo-OFL.txt +0 -0
  177. /package/{templates → template_project}/.claude/skills/canvas-design/canvas-fonts/NothingYouCouldDo-Regular.ttf +0 -0
  178. /package/{templates → template_project}/.claude/skills/canvas-design/canvas-fonts/Outfit-Bold.ttf +0 -0
  179. /package/{templates → template_project}/.claude/skills/canvas-design/canvas-fonts/Outfit-OFL.txt +0 -0
  180. /package/{templates → template_project}/.claude/skills/canvas-design/canvas-fonts/Outfit-Regular.ttf +0 -0
  181. /package/{templates → template_project}/.claude/skills/canvas-design/canvas-fonts/Tektur-Medium.ttf +0 -0
  182. /package/{templates → template_project}/.claude/skills/canvas-design/canvas-fonts/Tektur-OFL.txt +0 -0
  183. /package/{templates → template_project}/.claude/skills/canvas-design/canvas-fonts/Tektur-Regular.ttf +0 -0
  184. /package/{templates → template_project}/.claude/skills/canvas-design/canvas-fonts/YoungSerif-OFL.txt +0 -0
  185. /package/{templates → template_project}/.claude/skills/canvas-design/canvas-fonts/YoungSerif-Regular.ttf +0 -0
  186. /package/{templates → template_project}/.claude/skills/canvas-design/philosophy-examples.md +0 -0
  187. /package/{templates → template_project}/.claude/skills/code-review/SKILL.md +0 -0
  188. /package/{templates → template_project}/.claude/skills/debugging-toolkit/SKILL.md +0 -0
  189. /package/{templates → template_project}/.claude/skills/debugging-toolkit/reference-tables.md +0 -0
  190. /package/{templates → template_project}/.claude/skills/delivery/SKILL.md +0 -0
  191. /package/{templates → template_project}/.claude/skills/discover-security/SKILL.md +0 -0
  192. /package/{templates → template_project}/.claude/skills/docker-packaging/SKILL.md +0 -0
  193. /package/{templates → template_project}/.claude/skills/docs-manager/SKILL.md +0 -0
  194. /package/{templates → template_project}/.claude/skills/docs-manager/conventions-and-examples.md +0 -0
  195. /package/{templates → template_project}/.claude/skills/docs-manager/init-project-docs.sh +0 -0
  196. /package/{templates → template_project}/.claude/skills/docs-manager/templates/README.md.template +0 -0
  197. /package/{templates → template_project}/.claude/skills/docs-manager/templates/agent-roles.md.template +0 -0
  198. /package/{templates → template_project}/.claude/skills/docs-manager/templates/coding-conventions.md.template +0 -0
  199. /package/{templates → template_project}/.claude/skills/docs-manager/templates/memory.md.template +0 -0
  200. /package/{templates → template_project}/.claude/skills/docs-manager/templates/onboarding.md.template +0 -0
  201. /package/{templates → template_project}/.claude/skills/docs-manager/templates/project.md.template +0 -0
  202. /package/{templates → template_project}/.claude/skills/docs-quality/SKILL.md +0 -0
  203. /package/{templates → template_project}/.claude/skills/docx/LICENSE.txt +0 -0
  204. /package/{templates → template_project}/.claude/skills/docx/SKILL.md +0 -0
  205. /package/{templates → template_project}/.claude/skills/docx/docx-js.md +0 -0
  206. /package/{templates → template_project}/.claude/skills/docx/ooxml.md +0 -0
  207. /package/{templates → template_project}/.claude/skills/docx/redlining-reference.md +0 -0
  208. /package/{templates → template_project}/.claude/skills/docx/scripts/__init__.py +0 -0
  209. /package/{templates → template_project}/.claude/skills/docx/scripts/document.py +0 -0
  210. /package/{templates → template_project}/.claude/skills/docx/scripts/templates/comments.xml +0 -0
  211. /package/{templates → template_project}/.claude/skills/docx/scripts/templates/commentsExtended.xml +0 -0
  212. /package/{templates → template_project}/.claude/skills/docx/scripts/templates/commentsExtensible.xml +0 -0
  213. /package/{templates → template_project}/.claude/skills/docx/scripts/templates/commentsIds.xml +0 -0
  214. /package/{templates → template_project}/.claude/skills/docx/scripts/templates/people.xml +0 -0
  215. /package/{templates → template_project}/.claude/skills/docx/scripts/utilities.py +0 -0
  216. /package/{templates → template_project}/.claude/skills/duraone/SKILL.md +0 -0
  217. /package/{templates → template_project}/.claude/skills/duraone/references/backend.md +0 -0
  218. /package/{templates → template_project}/.claude/skills/duraone/references/frontend.md +0 -0
  219. /package/{templates → template_project}/.claude/skills/duraone/references/sql.md +0 -0
  220. /package/{templates → template_project}/.claude/skills/duraone/references/workflow.md +0 -0
  221. /package/{templates → template_project}/.claude/skills/executing-plans/SKILL.md +0 -0
  222. /package/{templates → template_project}/.claude/skills/file-organizer/SKILL.md +0 -0
  223. /package/{templates → template_project}/.claude/skills/file-organizer/examples-and-practices.md +0 -0
  224. /package/{templates → template_project}/.claude/skills/frontend/SKILL.md +0 -0
  225. /package/{templates → template_project}/.claude/skills/frontend-design/LICENSE.txt +0 -0
  226. /package/{templates → template_project}/.claude/skills/frontend-design/SKILL.md +0 -0
  227. /package/{templates → template_project}/.claude/skills/frontend-vue/SKILL.md +0 -0
  228. /package/{templates → template_project}/.claude/skills/frontend-vue/components/Control/Box.vue +0 -0
  229. /package/{templates → template_project}/.claude/skills/frontend-vue/components/Control/Button.vue +0 -0
  230. /package/{templates → template_project}/.claude/skills/frontend-vue/components/Control/ButtonBar.vue +0 -0
  231. /package/{templates → template_project}/.claude/skills/frontend-vue/components/Control/ButtonFloat.vue +0 -0
  232. /package/{templates → template_project}/.claude/skills/frontend-vue/components/Control/CheckButton.vue +0 -0
  233. /package/{templates → template_project}/.claude/skills/frontend-vue/components/Control/Checkbox.vue +0 -0
  234. /package/{templates → template_project}/.claude/skills/frontend-vue/components/Control/Datetime.vue +0 -0
  235. /package/{templates → template_project}/.claude/skills/frontend-vue/components/Control/Dropdownlist.vue +0 -0
  236. /package/{templates → template_project}/.claude/skills/frontend-vue/components/Control/Input.vue +0 -0
  237. /package/{templates → template_project}/.claude/skills/frontend-vue/components/Control/Label.vue +0 -0
  238. /package/{templates → template_project}/.claude/skills/frontend-vue/components/Control/Master/BoxColumn.vue +0 -0
  239. /package/{templates → template_project}/.claude/skills/frontend-vue/components/Control/Popup/Confirm.vue +0 -0
  240. /package/{templates → template_project}/.claude/skills/frontend-vue/components/Control/Popup/Info.vue +0 -0
  241. /package/{templates → template_project}/.claude/skills/frontend-vue/components/Control/Popup/ModalInfo.vue +0 -0
  242. /package/{templates → template_project}/.claude/skills/frontend-vue/components/Control/Popup/Reject.vue +0 -0
  243. /package/{templates → template_project}/.claude/skills/frontend-vue/components/Control/Tag.vue +0 -0
  244. /package/{templates → template_project}/.claude/skills/frontend-vue/components/Control/Upload.vue +0 -0
  245. /package/{templates → template_project}/.claude/skills/frontend-vue/components/ControlMobile/Dropdownlist.vue +0 -0
  246. /package/{templates → template_project}/.claude/skills/frontend-vue/components/ControlMobile/PagingBar.vue +0 -0
  247. /package/{templates → template_project}/.claude/skills/frontend-vue/components/ControlMobile/UploadImage.vue +0 -0
  248. /package/{templates → template_project}/.claude/skills/frontend-vue/components/Grid/AG.vue +0 -0
  249. /package/{templates → template_project}/.claude/skills/frontend-vue/components/Grid/AntTable.vue +0 -0
  250. /package/{templates → template_project}/.claude/skills/frontend-vue/components/Grid/CustomDropdownEditor.vue +0 -0
  251. /package/{templates → template_project}/.claude/skills/frontend-vue/components/Grid/CustomDropdownEditorEnable.vue +0 -0
  252. /package/{templates → template_project}/.claude/skills/frontend-vue/components/Grid/HtmlTable.vue +0 -0
  253. /package/{templates → template_project}/.claude/skills/frontend-vue/components/PDFViewer.vue +0 -0
  254. /package/{templates → template_project}/.claude/skills/frontend-vue/components/Panel/FormView.vue +0 -0
  255. /package/{templates → template_project}/.claude/skills/frontend-vue/components/Partial/Footer.vue +0 -0
  256. /package/{templates → template_project}/.claude/skills/frontend-vue/components/Partial/Header.vue +0 -0
  257. /package/{templates → template_project}/.claude/skills/frontend-vue/components/Partial/Sidebar.vue +0 -0
  258. /package/{templates → template_project}/.claude/skills/frontend-vue/components/Template.vue +0 -0
  259. /package/{templates → template_project}/.claude/skills/frontend-vue/components/View/Form.vue +0 -0
  260. /package/{templates → template_project}/.claude/skills/frontend-vue/composables/indexDBStore.js +0 -0
  261. /package/{templates → template_project}/.claude/skills/frontend-vue/composables/masterApi.js +0 -0
  262. /package/{templates → template_project}/.claude/skills/frontend-vue/composables/state.js +0 -0
  263. /package/{templates → template_project}/.claude/skills/frontend-vue/composables/useRequest.js +0 -0
  264. /package/{templates → template_project}/.claude/skills/frontend-vue/composables/useSession.js +0 -0
  265. /package/{templates → template_project}/.claude/skills/frontend-vue/composables/useTranslation.js +0 -0
  266. /package/{templates → template_project}/.claude/skills/frontend-vue/composables/useWebSocket.js +0 -0
  267. /package/{templates → template_project}/.claude/skills/frontend-vue/composables/userObj.js +0 -0
  268. /package/{templates → template_project}/.claude/skills/frontend-vue/composables/utils.js +0 -0
  269. /package/{templates → template_project}/.claude/skills/frontend-vue/reference/composables-example.vue +0 -0
  270. /package/{templates → template_project}/.claude/skills/frontend-vue/reference/form-example.vue +0 -0
  271. /package/{templates → template_project}/.claude/skills/frontend-vue/reference/grid-example.vue +0 -0
  272. /package/{templates → template_project}/.claude/skills/frontend-vue/reference/masterdata-example/[id].vue +0 -0
  273. /package/{templates → template_project}/.claude/skills/frontend-vue/reference/masterdata-example/index.vue +0 -0
  274. /package/{templates → template_project}/.claude/skills/frontend-vue/reference/popup-example.vue +0 -0
  275. /package/{templates → template_project}/.claude/skills/next-step/SKILL.md +0 -0
  276. /package/{templates → template_project}/.claude/skills/pdf/LICENSE.txt +0 -0
  277. /package/{templates → template_project}/.claude/skills/pdf/SKILL.md +0 -0
  278. /package/{templates → template_project}/.claude/skills/pdf/forms.md +0 -0
  279. /package/{templates → template_project}/.claude/skills/pdf/reference.md +0 -0
  280. /package/{templates → template_project}/.claude/skills/pdf/scripts/check_bounding_boxes.py +0 -0
  281. /package/{templates → template_project}/.claude/skills/pdf/scripts/check_bounding_boxes_test.py +0 -0
  282. /package/{templates → template_project}/.claude/skills/pdf/scripts/check_fillable_fields.py +0 -0
  283. /package/{templates → template_project}/.claude/skills/pdf/scripts/convert_pdf_to_images.py +0 -0
  284. /package/{templates → template_project}/.claude/skills/pdf/scripts/create_validation_image.py +0 -0
  285. /package/{templates → template_project}/.claude/skills/pdf/scripts/extract_form_field_info.py +0 -0
  286. /package/{templates → template_project}/.claude/skills/pdf/scripts/fill_fillable_fields.py +0 -0
  287. /package/{templates → template_project}/.claude/skills/pdf/scripts/fill_pdf_form_with_annotations.py +0 -0
  288. /package/{templates → template_project}/.claude/skills/pdf-processing/SKILL.md +0 -0
  289. /package/{templates → template_project}/.claude/skills/pdf-processing-pro/FORMS.md +0 -0
  290. /package/{templates → template_project}/.claude/skills/pdf-processing-pro/OCR.md +0 -0
  291. /package/{templates → template_project}/.claude/skills/pdf-processing-pro/SKILL.md +0 -0
  292. /package/{templates → template_project}/.claude/skills/pdf-processing-pro/TABLES.md +0 -0
  293. /package/{templates → template_project}/.claude/skills/pdf-processing-pro/scripts/analyze_form.py +0 -0
  294. /package/{templates → template_project}/.claude/skills/pdf-processing-pro/workflows-and-troubleshooting.md +0 -0
  295. /package/{templates → template_project}/.claude/skills/postgres/SKILL.md +0 -0
  296. /package/{templates → template_project}/.claude/skills/postgres/reference/fn_get_examples.sql +0 -0
  297. /package/{templates → template_project}/.claude/skills/postgres/reference/fn_rpt_examples.sql +0 -0
  298. /package/{templates → template_project}/.claude/skills/postgres/reference/utility_functions.sql +0 -0
  299. /package/{templates → template_project}/.claude/skills/pptx/LICENSE.txt +0 -0
  300. /package/{templates → template_project}/.claude/skills/pptx/SKILL.md +0 -0
  301. /package/{templates → template_project}/.claude/skills/pptx/design-references.md +0 -0
  302. /package/{templates → template_project}/.claude/skills/pptx/html2pptx.md +0 -0
  303. /package/{templates → template_project}/.claude/skills/pptx/ooxml.md +0 -0
  304. /package/{templates → template_project}/.claude/skills/pptx/scripts/html2pptx.js +0 -0
  305. /package/{templates → template_project}/.claude/skills/pptx/scripts/inventory.py +0 -0
  306. /package/{templates → template_project}/.claude/skills/pptx/scripts/rearrange.py +0 -0
  307. /package/{templates → template_project}/.claude/skills/pptx/scripts/replace.py +0 -0
  308. /package/{templates → template_project}/.claude/skills/pptx/scripts/thumbnail.py +0 -0
  309. /package/{templates → template_project}/.claude/skills/pptx/template-replacement-reference.md +0 -0
  310. /package/{templates → template_project}/.claude/skills/pptx/utilities.md +0 -0
  311. /package/{templates → template_project}/.claude/skills/principle-attack-the-premise/SKILL.md +0 -0
  312. /package/{templates → template_project}/.claude/skills/principle-boundary-discipline/SKILL.md +0 -0
  313. /package/{templates → template_project}/.claude/skills/principle-encode-lessons-in-structure/SKILL.md +0 -0
  314. /package/{templates → template_project}/.claude/skills/principle-fix-root-causes/SKILL.md +0 -0
  315. /package/{templates → template_project}/.claude/skills/principle-foundational-thinking/SKILL.md +0 -0
  316. /package/{templates → template_project}/.claude/skills/principle-guard-the-context-window/SKILL.md +0 -0
  317. /package/{templates → template_project}/.claude/skills/principle-laziness-protocol/SKILL.md +0 -0
  318. /package/{templates → template_project}/.claude/skills/principle-migrate-callers-then-delete-legacy-apis/SKILL.md +0 -0
  319. /package/{templates → template_project}/.claude/skills/principle-minimize-reader-load/SKILL.md +0 -0
  320. /package/{templates → template_project}/.claude/skills/principle-model-the-domain/SKILL.md +0 -0
  321. /package/{templates → template_project}/.claude/skills/principle-never-block-on-the-human/SKILL.md +0 -0
  322. /package/{templates → template_project}/.claude/skills/principle-prove-it-works/SKILL.md +0 -0
  323. /package/{templates → template_project}/.claude/skills/principle-sequence-verifiable-units/SKILL.md +0 -0
  324. /package/{templates → template_project}/.claude/skills/principle-subtract-before-you-add/SKILL.md +0 -0
  325. /package/{templates → template_project}/.claude/skills/principle-test-behavior-not-implementation/SKILL.md +0 -0
  326. /package/{templates → template_project}/.claude/skills/project-learning/SKILL.md +0 -0
  327. /package/{templates → template_project}/.claude/skills/repo-maintenance/SKILL.md +0 -0
  328. /package/{templates → template_project}/.claude/skills/research/EXAMPLES.md +0 -0
  329. /package/{templates → template_project}/.claude/skills/research/REFERENCE.md +0 -0
  330. /package/{templates → template_project}/.claude/skills/research/SKILL.md +0 -0
  331. /package/{templates → template_project}/.claude/skills/root-cause-tracing/SKILL.md +0 -0
  332. /package/{templates → template_project}/.claude/skills/root-cause-tracing/diagrams.md +0 -0
  333. /package/{templates → template_project}/.claude/skills/root-cause-tracing/find-polluter.sh +0 -0
  334. /package/{templates → template_project}/.claude/skills/sharing-skills/SKILL.md +0 -0
  335. /package/{templates → template_project}/.claude/skills/sharing-skills/complete-example.md +0 -0
  336. /package/{templates → template_project}/.claude/skills/skill-quality/rationalization-table-template.md +0 -0
  337. /package/{templates → template_project}/.claude/skills/skill-quality/trigger-accuracy-template.md +0 -0
  338. /package/{templates → template_project}/.claude/skills/sql-optimization-patterns/SKILL.md +0 -0
  339. /package/{templates → template_project}/.claude/skills/sql-optimization-patterns/references/advanced-techniques.md +0 -0
  340. /package/{templates → template_project}/.claude/skills/sql-optimization-patterns/references/core-concepts.md +0 -0
  341. /package/{templates → template_project}/.claude/skills/sql-optimization-patterns/references/query-patterns.md +0 -0
  342. /package/{templates → template_project}/.claude/skills/subagent-driven-development/SKILL.md +0 -0
  343. /package/{templates → template_project}/.claude/skills/subagent-driven-development/example-workflow.md +0 -0
  344. /package/{templates → template_project}/.claude/skills/systematic-debugging/CREATION-LOG.md +0 -0
  345. /package/{templates → template_project}/.claude/skills/systematic-debugging/SKILL.md +0 -0
  346. /package/{templates → template_project}/.claude/skills/systematic-debugging/reference-tables.md +0 -0
  347. /package/{templates → template_project}/.claude/skills/systematic-debugging/test-academic.md +0 -0
  348. /package/{templates → template_project}/.claude/skills/systematic-debugging/test-pressure-1.md +0 -0
  349. /package/{templates → template_project}/.claude/skills/systematic-debugging/test-pressure-2.md +0 -0
  350. /package/{templates → template_project}/.claude/skills/systematic-debugging/test-pressure-3.md +0 -0
  351. /package/{templates → template_project}/.claude/skills/test-driven-development/SKILL.md +0 -0
  352. /package/{templates → template_project}/.claude/skills/test-driven-development/reference-tables.md +0 -0
  353. /package/{templates → template_project}/.claude/skills/testing-anti-patterns/SKILL.md +0 -0
  354. /package/{templates → template_project}/.claude/skills/testing-anti-patterns/reference-tables.md +0 -0
  355. /package/{templates → template_project}/.claude/skills/testing-quality/SKILL.md +0 -0
  356. /package/{templates → template_project}/.claude/skills/update-status/SKILL.md +0 -0
  357. /package/{templates → template_project}/.claude/skills/verification-before-completion/SKILL.md +0 -0
  358. /package/{templates → template_project}/.claude/skills/verification-before-completion/key-patterns.md +0 -0
  359. /package/{templates → template_project}/.claude/skills/webapp-testing/LICENSE.txt +0 -0
  360. /package/{templates → template_project}/.claude/skills/webapp-testing/SKILL.md +0 -0
  361. /package/{templates → template_project}/.claude/skills/webapp-testing/examples/console_logging.py +0 -0
  362. /package/{templates → template_project}/.claude/skills/webapp-testing/examples/element_discovery.py +0 -0
  363. /package/{templates → template_project}/.claude/skills/webapp-testing/examples/static_html_automation.py +0 -0
  364. /package/{templates → template_project}/.claude/skills/webapp-testing/scripts/with_server.py +0 -0
  365. /package/{templates → template_project}/.claude/ukit/index/anchor-search.mjs +0 -0
  366. /package/{templates → template_project}/.claude/ukit/index/build-index.mjs +0 -0
  367. /package/{templates → template_project}/.claude/ukit/index/cache-utils.mjs +0 -0
  368. /package/{templates → template_project}/.claude/ukit/index/extract-image.mjs +0 -0
  369. /package/{templates → template_project}/.claude/ukit/index/impact-context.mjs +0 -0
  370. /package/{templates → template_project}/.claude/ukit/index/post-edit-verify.mjs +0 -0
  371. /package/{templates → template_project}/.claude/ukit/index/pre-edit-backup.mjs +0 -0
  372. /package/{templates → template_project}/.claude/ukit/index/provision-worktree.mjs +0 -0
  373. /package/{templates → template_project}/.claude/ukit/index/query-index.mjs +0 -0
  374. /package/{templates → template_project}/.claude/ukit/index/refresh-index.mjs +0 -0
  375. /package/{templates → template_project}/.claude/ukit/index/reset-auto-permissions.mjs +0 -0
  376. /package/{templates → template_project}/.claude/ukit/index/resolve-context.mjs +0 -0
  377. /package/{templates → template_project}/.claude/ukit/index/route-catalog.mjs +0 -0
  378. /package/{templates → template_project}/.claude/ukit/index/safe-patch.mjs +0 -0
  379. /package/{templates → template_project}/.claude/ukit/index/stale-spec-check.mjs +0 -0
  380. /package/{templates → template_project}/.claude/ukit/index/task-budget-validator.mjs +0 -0
  381. /package/{templates → template_project}/.claude/ukit/index/triage.mjs +0 -0
  382. /package/{templates → template_project}/.claude/ukit/index/verify-context.mjs +0 -0
  383. /package/{templates → template_project}/.claude/ukit/runtime/async-lock.mjs +0 -0
  384. /package/{templates → template_project}/.claude/ukit/runtime/compact-threshold.mjs +0 -0
  385. /package/{templates → template_project}/.claude/ukit/runtime/context-capacity.mjs +0 -0
  386. /package/{templates → template_project}/.claude/ukit/runtime/hook-chain-budget.mjs +0 -0
  387. /package/{templates → template_project}/.claude/ukit/runtime/hook-chain-runner.mjs +0 -0
  388. /package/{templates → template_project}/.claude/ukit/runtime/hook-field-salvage.mjs +0 -0
  389. /package/{templates → template_project}/.claude/ukit/runtime/hook-input.mjs +0 -0
  390. /package/{templates → template_project}/.claude/ukit/runtime/hook-input.sh +0 -0
  391. /package/{templates → template_project}/.claude/ukit/runtime/hook-payload-store.mjs +0 -0
  392. /package/{templates → template_project}/.claude/ukit/runtime/hook-process.mjs +0 -0
  393. /package/{templates → template_project}/.claude/ukit/runtime/hook-telemetry.mjs +0 -0
  394. /package/{templates → template_project}/.claude/ukit/runtime/hook-telemetry.sh +0 -0
  395. /package/{templates → template_project}/.claude/ukit/runtime/output-compression.mjs +0 -0
  396. /package/{templates → template_project}/.claude/ukit/runtime/project-important.mjs +0 -0
  397. /package/{templates → template_project}/.claude/ukit/runtime/reinject-context.mjs +0 -0
  398. /package/{templates → template_project}/.claude/ukit/runtime/text-profile.mjs +0 -0
  399. /package/{templates → template_project}/.claude/ukit/runtime/token-utils.mjs +0 -0
  400. /package/{templates → template_project}/.claude/ukit/runtime/transcript-tail.mjs +0 -0
  401. /package/{templates → template_project}/.claude/ukit/skill-router-state.json +0 -0
  402. /package/{templates → template_project}/.codex/README.md +0 -0
  403. /package/{templates → template_project}/.codex/settings.json +0 -0
  404. /package/{templates → template_project}/.omp/AGENTS.md +0 -0
  405. /package/{templates → template_project}/.omp/README.md +0 -0
  406. /package/{templates → template_project}/.omp/agents/bug-debugger.md +0 -0
  407. /package/{templates → template_project}/.omp/agents/feature-implementer.md +0 -0
  408. /package/{templates → template_project}/.omp/agents/ukit-small-task-maintainer.md +0 -0
  409. /package/{templates → template_project}/.omp/agents/ukit-vision-analyst.md +0 -0
  410. /package/{templates → template_project}/.omp/hooks/pre/ukit-bridge.js +0 -0
  411. /package/{templates → template_project}/.ukit/storage/cache/hook-latency/unknown.jsonl +0 -0
  412. /package/{templates → template_project}/PROJECT_IMPORTANT.md +0 -0
  413. /package/{templates → template_project}/adapter-presets/claude/settings.local.json +0 -0
  414. /package/{templates → template_project}/adapter-presets/codex/settings.local.json +0 -0
  415. /package/{templates → template_project}/docs/AI_HANDOFF/ACTIVE.md +0 -0
  416. /package/{templates → template_project}/docs/AI_HANDOFF/HISTORY.md +0 -0
  417. /package/{templates → template_project}/docs/AI_HANDOFF/INDEX.md +0 -0
  418. /package/{templates → template_project}/docs/AI_HANDOFF/PLAN.md +0 -0
  419. /package/{templates → template_project}/docs/AI_HANDOFF/SPEC.md +0 -0
  420. /package/{templates → template_project}/docs/AI_HANDOFF/archive/.gitkeep +0 -0
  421. /package/{templates → template_project}/docs/AI_HANDOFF/tasks/.gitkeep +0 -0
  422. /package/{templates → template_project}/docs/AI_HANDOFF/tasks/_TEMPLATE.md +0 -0
  423. /package/{templates → template_project}/docs/BUGFIX.md +0 -0
  424. /package/{templates → template_project}/docs/BUG_INDEX.md +0 -0
  425. /package/{templates → template_project}/docs/BUG_METRICS.md +0 -0
  426. /package/{templates → template_project}/docs/BUG_TEMPLATE.md +0 -0
  427. /package/{templates → template_project}/docs/CODE_MAP.md +0 -0
  428. /package/{templates → template_project}/docs/MEMORY.md +0 -0
  429. /package/{templates → template_project}/docs/PROJECT.md +0 -0
  430. /package/{templates → template_project}/docs/PROMPT_CACHING.md +0 -0
  431. /package/{templates → template_project}/docs/WORKLOG.md +0 -0
  432. /package/{templates → template_project}/instructions/overlays/agents.md +0 -0
  433. /package/{templates → template_project}/instructions/overlays/omp-rules.md +0 -0
  434. /package/{templates → template_project}/instructions/repo-vars.yaml +0 -0
  435. /package/{templates → template_project}/ukit/README.md +0 -0
  436. /package/{templates → template_project}/ukit/storage/cache/compact-history.json +0 -0
  437. /package/{templates → template_project}/ukit/storage/cache/compact-pressure.json +0 -0
  438. /package/{templates → template_project}/ukit/storage/cache/output-history.json +0 -0
  439. /package/{templates → template_project}/ukit/storage/cache/prompt-cache.json +0 -0
  440. /package/{templates → template_project}/ukit/storage/memory/sessions/.gitkeep +0 -0
  441. /package/{templates → template_project}/ukit/storage/memory/user.json +0 -0
  442. /package/{templates/user → template_user}/README.md +0 -0
  443. /package/{templates/user → template_user}/playbooks/bug-fix.md +0 -0
  444. /package/{templates/user → template_user}/playbooks/issue-implementation.md +0 -0
  445. /package/{templates/user → template_user}/storage/config.json +0 -0
@@ -4,8 +4,8 @@
4
4
  // this file:
5
5
  // - src/index/taskRouting.js (in-process routing: contracts + risk profiles + mode order)
6
6
  // - src/core/runtimeConfig.js (config defaults: contracts minus runtime-only keys)
7
- // - templates/ukit/storage/config.json (literal mirror of the config defaults)
8
- // - templates/.claude/ukit/index/route-task.mjs (shipped standalone CLI: contracts + tiers)
7
+ // - template_project/ukit/storage/config.json (literal mirror of the config defaults)
8
+ // - template_project/.claude/ukit/index/route-task.mjs (shipped standalone CLI: contracts + tiers)
9
9
  //
10
10
  // route-task.mjs runs inside target projects and cannot import from src/, so it keeps a
11
11
  // literal copy — tests/consistency/executionContractSync.test.js locks that copy to these
@@ -90,6 +90,46 @@ export const MODEL_TIER_BY_CONTRACT = {
90
90
  'review-release': 'smart',
91
91
  };
92
92
 
93
+ // Decision table v2 (V3_RESHAPE §5): MODEL_TIER_BY_CONTRACT stays the base row;
94
+ // resolveModelTier adds the (riskFloor, hostCapabilities) columns. Deterministic —
95
+ // no registry, no leases, no outbound capability calls.
96
+ export const ROUTE_EFFORTS = new Set(['low', 'medium', 'high']);
97
+
98
+ // Tier ladder for the one-band high-risk escalation; effort rides the resolved tier.
99
+ const MODEL_TIER_ORDER = ['lite', 'code', 'smart'];
100
+ const MODEL_TIER_EFFORT = {
101
+ lite: 'low',
102
+ code: 'medium',
103
+ smart: 'high',
104
+ };
105
+
106
+ /**
107
+ * Resolves {tier, effort, advisoryOnly} for a route. A 'high-risk' floor escalates
108
+ * the tier one band (lite→code→smart, capped at smart) and forces effort 'high'.
109
+ * Unknown mode → {tier:null, effort:null, advisoryOnly:true}. Missing/unknown
110
+ * riskFloor → 'none'. Missing hostCapabilities → advisoryOnly:true (the route text
111
+ * is all the host gets when it cannot bind model and effort).
112
+ */
113
+ export function resolveModelTier({
114
+ executionMode = null,
115
+ riskFloor = null,
116
+ hostCapabilities = null,
117
+ } = {}) {
118
+ const baseTier = MODEL_TIER_BY_CONTRACT[executionMode] ?? null;
119
+ if (!baseTier) {
120
+ return { tier: null, effort: null, advisoryOnly: true };
121
+ }
122
+ const highRisk = riskFloor?.floor === 'high-risk';
123
+ const tier = highRisk
124
+ ? MODEL_TIER_ORDER[Math.min(MODEL_TIER_ORDER.indexOf(baseTier) + 1, MODEL_TIER_ORDER.length - 1)]
125
+ : baseTier;
126
+ return {
127
+ tier,
128
+ effort: highRisk ? 'high' : MODEL_TIER_EFFORT[tier],
129
+ advisoryOnly: !(hostCapabilities?.canBindModel === true && hostCapabilities?.canBindEffort === true),
130
+ };
131
+ }
132
+
93
133
  export const CONTRACT_RISK_PROFILES = {
94
134
  'tiny-fix': { riskLevel: 'minimal', contextPolicy: 'confirm-target-only' },
95
135
  'local-fix': { riskLevel: 'local', contextPolicy: 'bounded-local' },
@@ -2,9 +2,9 @@ import fs from 'node:fs/promises';
2
2
  import path from 'node:path';
3
3
 
4
4
  // The shipped runtime carries the single lock implementation; src and the
5
- // installed package always ship templates/ together (package.json files list),
5
+ // installed package always ship template_project/ together (package.json files list),
6
6
  // so the protocol twin delegates instead of keeping a driftable copy.
7
- import { journalDroppedLockMutation, withAsyncLock, withTransientFsRetry } from '../../templates/.claude/ukit/runtime/async-lock.mjs';
7
+ import { journalDroppedLockMutation, withAsyncLock, withTransientFsRetry } from '../../template_project/.claude/ukit/runtime/async-lock.mjs';
8
8
 
9
9
  export async function pathExists(targetPath) {
10
10
  try {
@@ -185,7 +185,7 @@ const LOCK_MAX_WAIT_MS = 5_000;
185
185
  * flows in one process (parallel subagents). The lock is a directory created next
186
186
  * to the target file: `mkdir` is atomic, so exactly one caller can create it.
187
187
  *
188
- * The entire lock protocol lives in templates/.claude/ukit/runtime/async-lock.mjs
188
+ * The entire lock protocol lives in template_project/.claude/ukit/runtime/async-lock.mjs
189
189
  * (TASK-004 fix round 1): owner stamping (pid + token + pstart), recycled-pid
190
190
  * detection via recordedProcessGone, claim+quarantine stale reclaim, and verified
191
191
  * release exist exactly once there — this function and the token-utils.mjs twin
@@ -10,7 +10,7 @@
10
10
  * error envelope slip through and kill the user's turn.
11
11
  *
12
12
  * Self-contained and hermetic: `fetchImpl` is injectable. `resolveGatewayBaseUrl` mirrors the
13
- * 3-tier probe order from templates/.claude/ukit/index/unic-gateway.mjs (env → project
13
+ * 3-tier probe order from template_project/.claude/ukit/index/unic-gateway.mjs (env → project
14
14
  * .claude/settings.json → home ~/.claude/settings.json) but is intentionally duplicated
15
15
  * here per PLAN.md §3 (cross-task coupling is the cheaper-than-it-looks debt — see plan).
16
16
  *
@@ -65,7 +65,7 @@ function readSettingsBaseUrl(filePath) {
65
65
 
66
66
  /**
67
67
  * Detects the current custom-gateway base URL using the same 3-tier probe order as
68
- * `templates/.claude/ukit/index/unic-gateway.mjs` (generalized — fires on any non-empty
68
+ * `template_project/.claude/ukit/index/unic-gateway.mjs` (generalized — fires on any non-empty
69
69
  * value, not only the UNIC token):
70
70
  * 1. env.ANTHROPIC_BASE_URL
71
71
  * 2. <projectRoot>/.claude/settings.json -> env.ANTHROPIC_BASE_URL
@@ -24,7 +24,7 @@ import path from 'node:path';
24
24
  // defaults on the next install instead of being mistaken for user intent. Re-running
25
25
  // `ukit install` is a no-op once the keys are in place.
26
26
  //
27
- // Probe order mirrors `templates/.claude/ukit/index/unic-gateway.mjs` (env → project
27
+ // Probe order mirrors `template_project/.claude/ukit/index/unic-gateway.mjs` (env → project
28
28
  // `.claude/settings.json` env → home `~/.claude/settings.json` env) but generalizes to ANY
29
29
  // non-empty `ANTHROPIC_BASE_URL`, not only `unicjsc.com`. The runtime template stays
30
30
  // scoped to UNIC because that's the lane-routing signal; here we only care that the user
@@ -82,7 +82,7 @@ function readBaseUrlFromSettingsFileSync(settingsPath) {
82
82
 
83
83
  /**
84
84
  * Detect whether ANY non-empty ANTHROPIC_BASE_URL is in scope, mirroring the probe order of
85
- * `templates/.claude/ukit/index/unic-gateway.mjs` but generalized. Probe order is strictly
85
+ * `template_project/.claude/ukit/index/unic-gateway.mjs` but generalized. Probe order is strictly
86
86
  * env → project `.claude/settings.json` → home `~/.claude/settings.json`; first non-empty
87
87
  * hit wins, and the returned `source` tells the caller which one matched.
88
88
  *
@@ -0,0 +1,152 @@
1
+ // handoffDocValidator.js — TASK-004 / Cycle C50 (mechanic #10, FR-007)
2
+ //
3
+ // Mechanical structure gate for handoff docs. Unlike taskBudgetValidator (advisory,
4
+ // exit 0), this validator is a REAL gate: the CLI twin exits 1 on any violation.
5
+ // Keep that difference explicit — do not "fix" the exit code.
6
+ //
7
+ // Exports:
8
+ // validateHandoffDoc(markdown, kind) → { ok: boolean, failures: string[] }
9
+ // kind ∈ 'plan' | 'task' | 'executor-report'
10
+ //
11
+ // Rules (SPEC §5 FR-007):
12
+ // plan — `## §1`..`## §6` headings present and in ascending order
13
+ // (extra trailing sections allowed), `## Planner Report`
14
+ // section containing `PLANNER_MODEL:`.
15
+ // task — required `## ` sections: Goal, Target Files, Test Cases,
16
+ // Test Files, Verification Commands, Acceptance Criteria,
17
+ // Dependencies, Interfaces; plus a `- Status:` field.
18
+ // When the doc also carries `## Executor Report`, the report
19
+ // header fields are validated too.
20
+ // executor-report — required fields: EXECUTOR_TOOL, EXECUTOR_MODEL,
21
+ // EXECUTOR_SUBAGENT, RED_OUTPUT.
22
+ //
23
+ // Parsing is deliberately markdown-light and dependency-free so the logic can be
24
+ // duplicated byte-for-byte into the shipped CLI twin
25
+ // (template_project/.claude/ukit/index/handoff-doc-validator.mjs) without
26
+ // dragging `src/` into user installs — same pattern as taskBudgetValidator (C12).
27
+
28
+ const PLAN_SECTIONS = ['§1', '§2', '§3', '§4', '§5', '§6'];
29
+
30
+ const TASK_SECTIONS = [
31
+ 'Goal',
32
+ 'Target Files',
33
+ 'Test Cases',
34
+ 'Test Files',
35
+ 'Verification Commands',
36
+ 'Acceptance Criteria',
37
+ 'Dependencies',
38
+ 'Interfaces',
39
+ ];
40
+
41
+ const REPORT_FIELDS = ['EXECUTOR_TOOL', 'EXECUTOR_MODEL', 'EXECUTOR_SUBAGENT', 'RED_OUTPUT'];
42
+
43
+ // Section helpers. Any line starting with `## ` opens a section; the body runs
44
+ // until the next `## ` line or EOF. Returns [{ name, body, pos }] in file order.
45
+ function splitSections(markdown) {
46
+ const sections = [];
47
+ const lines = String(markdown).split('\n');
48
+ let current = null;
49
+ lines.forEach((line, idx) => {
50
+ const m = line.match(/^##\s+(.+?)\s*$/);
51
+ if (m) {
52
+ current = { name: m[1], body: '', pos: idx };
53
+ sections.push(current);
54
+ } else if (current) {
55
+ current.body += line + '\n';
56
+ }
57
+ });
58
+ return sections;
59
+ }
60
+
61
+ // Positions of `## §<n>` headings, keyed by the literal token ('§1'..'§6').
62
+ // A heading matches when its name starts with the token (`## §1 Intent`).
63
+ function planSectionPositions(sections) {
64
+ const positions = new Map();
65
+ for (const s of sections) {
66
+ for (const token of PLAN_SECTIONS) {
67
+ if (!positions.has(token) && s.name.startsWith(token)) positions.set(token, s.pos);
68
+ }
69
+ }
70
+ return positions;
71
+ }
72
+
73
+ function hasSection(sections, name) {
74
+ return sections.some((s) => s.name === name || s.name.startsWith(`${name} `) || s.name.startsWith(`${name}(`));
75
+ }
76
+
77
+ function getSection(sections, name) {
78
+ return sections.find((s) => s.name === name || s.name.startsWith(`${name} `) || s.name.startsWith(`${name}(`));
79
+ }
80
+
81
+ function validatePlan(markdown) {
82
+ const failures = [];
83
+ const sections = splitSections(markdown);
84
+ const positions = planSectionPositions(sections);
85
+
86
+ for (const token of PLAN_SECTIONS) {
87
+ if (!positions.has(token)) failures.push(`missing required section heading "## ${token}"`);
88
+ }
89
+
90
+ // Order check over the sections that exist: each must appear after the
91
+ // highest position seen so far.
92
+ let maxPos = -1;
93
+ for (const token of PLAN_SECTIONS) {
94
+ const pos = positions.get(token);
95
+ if (pos === undefined) continue;
96
+ if (pos < maxPos) {
97
+ failures.push(`section order violation: "## ${token}" appears after a later section`);
98
+ } else {
99
+ maxPos = pos;
100
+ }
101
+ }
102
+
103
+ const report = getSection(sections, 'Planner Report');
104
+ if (!report) {
105
+ failures.push('missing required section "## Planner Report"');
106
+ } else if (!/^PLANNER_MODEL\s*:/m.test(report.body)) {
107
+ failures.push('missing required field "PLANNER_MODEL:" inside "## Planner Report"');
108
+ }
109
+
110
+ return failures;
111
+ }
112
+
113
+ function validateExecutorReportFields(markdown, prefix) {
114
+ const failures = [];
115
+ for (const field of REPORT_FIELDS) {
116
+ if (!new RegExp(`^${field}\\s*:`, 'm').test(markdown)) {
117
+ failures.push(`${prefix}missing required field "${field}:"`);
118
+ }
119
+ }
120
+ return failures;
121
+ }
122
+
123
+ function validateTask(markdown) {
124
+ const failures = [];
125
+ const sections = splitSections(markdown);
126
+
127
+ for (const name of TASK_SECTIONS) {
128
+ if (!hasSection(sections, name)) failures.push(`missing required section "## ${name}"`);
129
+ }
130
+ if (!/^\s*-?\s*Status\s*:/m.test(markdown)) {
131
+ failures.push('missing required field "Status:"');
132
+ }
133
+
134
+ // A task file that already carries an Executor Report must satisfy the
135
+ // report header contract too (FR-007).
136
+ const report = getSection(sections, 'Executor Report');
137
+ if (report) {
138
+ failures.push(...validateExecutorReportFields(report.body, 'executor-report: '));
139
+ }
140
+
141
+ return failures;
142
+ }
143
+
144
+ export function validateHandoffDoc(markdown, kind) {
145
+ const text = String(markdown ?? '');
146
+ let failures;
147
+ if (kind === 'plan') failures = validatePlan(text);
148
+ else if (kind === 'task') failures = validateTask(text);
149
+ else if (kind === 'executor-report') failures = validateExecutorReportFields(text, '');
150
+ else failures = [`unknown kind "${kind}" (expected plan|task|executor-report)`];
151
+ return { ok: failures.length === 0, failures };
152
+ }
@@ -354,7 +354,7 @@ function buildRecoveryHintSummary(summary, rawPath, { tokensBefore = 0 } = {}) {
354
354
  }
355
355
 
356
356
  // --- tee/ cache bound (BUG-C21-07, FR-006) -----------------------------------
357
- // Mirror of the bound in templates/.claude/ukit/runtime/output-compression.mjs —
357
+ // Mirror of the bound in template_project/.claude/ukit/runtime/output-compression.mjs —
358
358
  // keep the two implementations identical. persistRawOutput wrote one preserved
359
359
  // file per compression and nothing ever deleted from tee/. Sweeps are SAMPLED
360
360
  // (~1/16 writes, UKIT_TEE_SWEEP_PROBABILITY to force/disable) and BOUNDED
package/src/core/paths.js CHANGED
@@ -6,7 +6,8 @@ export function buildPathConfig({ packageRoot, projectRoot }) {
6
6
  projectRoot,
7
7
  manifestPath: path.join(packageRoot, 'manifests', 'platform.full.yaml'),
8
8
  userManifestPath: path.join(packageRoot, 'manifests', 'platform.user.yaml'),
9
- templatesRoot: path.join(packageRoot, 'templates'),
9
+ templatesRoot: path.join(packageRoot, 'template_project'),
10
+ userTemplatesRoot: path.join(packageRoot, 'template_user'),
10
11
  ukitRoot: path.join(projectRoot, '.claude', 'ukit', '.ukit'),
11
12
  installMetaPath: path.join(projectRoot, '.claude', 'ukit', '.ukit', 'install.json'),
12
13
  backupRoot: path.join(projectRoot, '.claude', 'ukit', '.ukit', 'backups'),
@@ -0,0 +1,120 @@
1
+ // reviewPanelAggregate.js — TASK-004 / Cycle C50 (mechanic #10, FR-008)
2
+ //
3
+ // Deterministic aggregation of `## Reviewer Verdict` blocks written by the
4
+ // `modelRoles['review-panel']` diversity-review panel (mechanic #6). The
5
+ // orchestrator stays context-lean: this script does the consensus math.
6
+ //
7
+ // Exports:
8
+ // parseVerdictBlock(text) → { member, verdict, findings } | null
9
+ // aggregatePanelVerdicts(verdicts: string[]) →
10
+ // { agreementMap: [{ finding, members[] }],
11
+ // verdict: 'approved' | 'approved_minor' | 'changes_requested',
12
+ // highSignal: [{ finding, members[] }],
13
+ // unparsed: string[] }
14
+ //
15
+ // Consensus rules (SPEC §5 FR-008):
16
+ // changes_requested — ≥1 CRITICAL verdict, ≥1 critical-severity finding,
17
+ // or ≥2 CHANGES-REQUESTED verdicts.
18
+ // approved — ≥2 APPROVED verdicts and no critical.
19
+ // approved_minor — everything else (incl. degenerate/empty panel).
20
+ //
21
+ // High signal: a finding reported by ≥2 panel members, or any critical-severity
22
+ // finding (a lone critical must never be buried below the lead's judgment).
23
+ //
24
+ // Advisory class: the CLI twin always exits 0.
25
+ //
26
+ // Parsing is deliberately markdown-light and dependency-free so the logic can be
27
+ // duplicated byte-for-byte into the shipped CLI twin
28
+ // (template_project/.claude/ukit/index/review-panel-aggregate.mjs) — same
29
+ // pattern as taskBudgetValidator (C12).
30
+
31
+ const SEVERITIES = ['critical', 'important', 'minor'];
32
+
33
+ // Parse one `## Reviewer Verdict` block (format: code-reviewer.md §Output).
34
+ // Returns null when no recognizable VERDICT line exists — the block is then
35
+ // counted as absent and named in `unparsed`.
36
+ export function parseVerdictBlock(text) {
37
+ const src = String(text ?? '');
38
+ const verdictMatch = src.match(/^VERDICT\s*:\s*(APPROVED-WITH-MINOR|APPROVED|CHANGES-REQUESTED|CRITICAL)\s*$/im);
39
+ if (!verdictMatch) return null;
40
+
41
+ const memberMatch = src.match(/^PANEL_MEMBER\s*:\s*(\S+)\s*$/im);
42
+ const member = memberMatch && memberMatch[1] !== '-' ? memberMatch[1] : null;
43
+
44
+ const findings = { critical: [], important: [], minor: [] };
45
+ const findingsMatch = src.match(/^FINDINGS:\s*$/im);
46
+ if (findingsMatch) {
47
+ const rest = src.slice(findingsMatch.index + findingsMatch[0].length);
48
+ let severity = null;
49
+ for (const line of rest.split('\n')) {
50
+ if (/^\S/.test(line)) break; // next top-level field ends FINDINGS
51
+ const sev = line.match(/^\s{2}(critical|important|minor)\s*:/);
52
+ if (sev) {
53
+ severity = sev[1];
54
+ continue;
55
+ }
56
+ const item = line.match(/^\s{4}-\s+(.+?)\s*$/);
57
+ if (item && severity) {
58
+ const text2 = item[1];
59
+ if (text2 !== 'none' && text2 !== '-') findings[severity].push(text2);
60
+ }
61
+ }
62
+ }
63
+
64
+ return { member, verdict: verdictMatch[1].toUpperCase(), findings };
65
+ }
66
+
67
+ // Normalize a finding bullet for identity comparison: two members report the
68
+ // "identical finding" when the normalized text matches.
69
+ function normalizeFinding(text) {
70
+ return String(text).replace(/\s+/g, ' ').trim().toLowerCase();
71
+ }
72
+
73
+ export function aggregatePanelVerdicts(verdicts) {
74
+ const list = Array.isArray(verdicts) ? verdicts : [];
75
+ const parsed = [];
76
+ const unparsed = [];
77
+
78
+ list.forEach((block, i) => {
79
+ const p = parseVerdictBlock(block);
80
+ if (p) parsed.push({ ...p, label: p.member || `verdict[${i}]` });
81
+ else unparsed.push(`verdict[${i}]`);
82
+ });
83
+
84
+ // Agreement Map: finding → set of panel members reporting it.
85
+ const map = new Map(); // normalized → { finding, members:Set, critical:boolean }
86
+ for (const p of parsed) {
87
+ for (const sev of SEVERITIES) {
88
+ for (const f of p.findings[sev]) {
89
+ const key = normalizeFinding(f);
90
+ let entry = map.get(key);
91
+ if (!entry) {
92
+ entry = { finding: f, members: new Set(), critical: sev === 'critical' };
93
+ map.set(key, entry);
94
+ }
95
+ entry.members.add(p.label);
96
+ if (sev === 'critical') entry.critical = true;
97
+ }
98
+ }
99
+ }
100
+
101
+ const agreementMap = [...map.values()].map((e) => ({
102
+ finding: e.finding,
103
+ members: [...e.members],
104
+ }));
105
+ const highSignal = [...map.values()]
106
+ .filter((e) => e.members.size >= 2 || e.critical)
107
+ .map((e) => ({ finding: e.finding, members: [...e.members] }));
108
+
109
+ const approvals = parsed.filter((p) => p.verdict === 'APPROVED').length;
110
+ const changeRequests = parsed.filter((p) => p.verdict === 'CHANGES-REQUESTED').length;
111
+ const hasCritical =
112
+ parsed.some((p) => p.verdict === 'CRITICAL') || parsed.some((p) => p.findings.critical.length > 0);
113
+
114
+ let verdict;
115
+ if (hasCritical || changeRequests >= 2) verdict = 'changes_requested';
116
+ else if (approvals >= 2) verdict = 'approved';
117
+ else verdict = 'approved_minor';
118
+
119
+ return { agreementMap, verdict, highSignal, unparsed };
120
+ }
@@ -274,16 +274,18 @@ async function runUserLayerPass({
274
274
  // project install — the whole pass is advisory.
275
275
  const userPaths = buildUserPaths({ homeDir });
276
276
  userLayer.userRoot = userPaths.userRoot;
277
- // pathConfig.userManifestPath is set by buildPathConfig; fall back to the
278
- // package layout (templatesRoot's sibling manifests/) for callers that build
279
- // pathConfig by hand (tests, embedded runners).
277
+ // pathConfig.userManifestPath / userTemplatesRoot are set by buildPathConfig;
278
+ // fall back to the package layout (templatesRoot's siblings manifests/ and
279
+ // template_user/) for callers that build pathConfig by hand.
280
280
  const userManifestPath = pathConfig.userManifestPath
281
281
  ?? path.join(pathConfig.templatesRoot, '..', 'manifests', 'platform.user.yaml');
282
+ const userTemplatesRoot = pathConfig.userTemplatesRoot
283
+ ?? path.join(pathConfig.templatesRoot, '..', 'template_user');
282
284
  const userManifest = await loadManifest(userManifestPath);
283
285
  const userPlan = await buildInstallPlan({
284
286
  manifest: userManifest,
285
287
  stackContext,
286
- templatesRoot: pathConfig.templatesRoot,
288
+ templatesRoot: userTemplatesRoot,
287
289
  variables,
288
290
  projectRoot: userPaths.userRoot,
289
291
  selectedAdapterItemIds,
@@ -259,6 +259,9 @@ export function buildDefaultRuntimeConfig(overrides = {}) {
259
259
  // key treats absence as "off"; stages promote off -> shadow -> canary -> default.
260
260
  routing: {
261
261
  routeSchema: { stage: 'off' },
262
+ rigor: { stage: 'off' },
263
+ fastPath: { stage: 'off' },
264
+ escalation: { stage: 'off' },
262
265
  },
263
266
  // SPEC-model-roles: role→tier map injected into delegating-lane route output.
264
267
  // Values are tier names or 'inherit-parent' — never raw provider model IDs.
@@ -537,12 +540,16 @@ export function validateRuntimeConfig(config) {
537
540
  errors.push('routing must be an object.');
538
541
  } else {
539
542
  const VALID_ROUTE_STAGES = new Set(['off', 'shadow', 'canary', 'default']);
540
- if (config.routing.routeSchema !== undefined) {
541
- if (!isPlainObject(config.routing.routeSchema)) {
542
- errors.push('routing.routeSchema must be an object.');
543
- } else if (config.routing.routeSchema.stage !== undefined
544
- && !VALID_ROUTE_STAGES.has(config.routing.routeSchema.stage)) {
545
- errors.push(`routing.routeSchema.stage must be one of: ${[...VALID_ROUTE_STAGES].join(', ')}.`);
543
+ for (const key of ['routeSchema', 'rigor', 'fastPath', 'escalation']) {
544
+ const stageKey = config.routing[key];
545
+ if (stageKey === undefined) {
546
+ continue;
547
+ }
548
+ if (!isPlainObject(stageKey)) {
549
+ errors.push(`routing.${key} must be an object.`);
550
+ } else if (stageKey.stage !== undefined
551
+ && !VALID_ROUTE_STAGES.has(stageKey.stage)) {
552
+ errors.push(`routing.${key}.stage must be one of: ${[...VALID_ROUTE_STAGES].join(', ')}.`);
546
553
  }
547
554
  }
548
555
  }
@@ -2,7 +2,7 @@
2
2
  * sensitiveValueScanner.js (TASK-036)
3
3
  *
4
4
  * Shared source-side extraction of the high-confidence secret *value* scanner
5
- * that lives in templates/.claude/hooks/sensitive-data-guard.sh. One semantic
5
+ * that lives in template_project/.claude/hooks/sensitive-data-guard.sh. One semantic
6
6
  * implementation is consumed by the runtime hook mirror (TASK-038/039) and the
7
7
  * PROJECT_IMPORTANT.md renderer (TASK-037).
8
8
  *
@@ -27,7 +27,7 @@
27
27
  // never crash.
28
28
  //
29
29
  // Parsing is deliberately markdown-light and dependency-free so the validator can be
30
- // duplicated byte-for-byte into the shipped CLI twin (templates/.claude/ukit/index/
30
+ // duplicated byte-for-byte into the shipped CLI twin (template_project/.claude/ukit/index/
31
31
  // task-budget-validator.mjs) without dragging `src/` into user installs.
32
32
 
33
33
  export const DEFAULT_CRITERIA = Object.freeze({
@@ -57,7 +57,7 @@ function execOmpConfigGet(projectRoot, ompPath) {
57
57
 
58
58
  async function readTemplateDenyMatches() {
59
59
  try {
60
- const text = await fs.readFile(path.join(PACKAGE_ROOT, 'templates', '.omp', 'config.yml'), 'utf8');
60
+ const text = await fs.readFile(path.join(PACKAGE_ROOT, 'template_project', '.omp', 'config.yml'), 'utf8');
61
61
  const parsed = parse(text.replace(TEMPLATE_PLACEHOLDER_PATTERN, '0'));
62
62
  const patterns = parsed?.bash?.patterns;
63
63
  if (!Array.isArray(patterns)) return [];
@@ -21,7 +21,7 @@ const INSTALLED_MARKERS = ['.ukit', '.claude', 'CLAUDE.md', 'AGENTS.md', '.codex
21
21
  // signal-ignoring child blocks indefinitely, SIGKILL returns ~immediately with
22
22
  // ETIMEDOUT. Direct-child kill only (no process-group tree kill): these are
23
23
  // short-lived CLI one-shots; the detached-group TERM→KILL posture stays in
24
- // templates/.claude/ukit/runtime/hook-process.mjs where hooks need it.
24
+ // template_project/.claude/ukit/runtime/hook-process.mjs where hooks need it.
25
25
  export const NPM_QUERY_TIMEOUT_MS = 15_000;
26
26
  export const NPM_INSTALL_TIMEOUT_MS = 10 * 60 * 1000;
27
27
  const KILL_ON_TIMEOUT = 'SIGKILL';
@@ -1910,7 +1910,7 @@ function areBugIndexSnapshotsEqual(previousSnapshot, nextSnapshot) {
1910
1910
  * fell back to the project root when NONE of them existed. Partial matches were
1911
1911
  * the trap: a repo with a top-level `tests/` but its code in `packages/` indexed
1912
1912
  * `tests/` and silently nothing else. UKit's own repo hit exactly that — `src`,
1913
- * `tests` and `manifests` all exist, so `templates/` (the entire shipped payload)
1913
+ * `tests` and `manifests` all exist, so `template_project/` (the entire shipped payload)
1914
1914
  * was never indexed, and three releases shipped features that were dead on
1915
1915
  * arrival because the index kept pointing at `src/` and the hand-maintained
1916
1916
  * `.claude/` dev mirror instead.
@@ -2115,7 +2115,7 @@ async function collectGitTrackedFiles(rootDir, discovery = null) {
2115
2115
  return false;
2116
2116
  }
2117
2117
  // Git already applied the project's own ignore rules, so dot-directories it
2118
- // still lists are deliberate (UKit's `templates/.claude/**` is force-added).
2118
+ // still lists are deliberate (UKit's `template_project/.claude/**` is force-added).
2119
2119
  // All that is left to defend against is a build directory someone committed.
2120
2120
  return !relativePath.split('/').some((segment) => EXCLUDED_DIR_NAMES.has(segment));
2121
2121
  });
@@ -24,11 +24,11 @@ const SHARED_IMPACT_PATTERNS = [
24
24
  label: 'shared-token-runtime',
25
25
  },
26
26
  {
27
- regex: /^templates\/\.claude\/hooks\//,
27
+ regex: /^template_project\/\.claude\/hooks\//,
28
28
  label: 'installed-hook-runtime',
29
29
  },
30
30
  {
31
- regex: /^templates\/\.claude\/ukit\//,
31
+ regex: /^template_project\/\.claude\/ukit\//,
32
32
  label: 'installed-helper-runtime',
33
33
  },
34
34
  {
@@ -36,7 +36,7 @@ const SHARED_IMPACT_PATTERNS = [
36
36
  label: 'install-manifest',
37
37
  },
38
38
  {
39
- regex: /^templates\//,
39
+ regex: /^template_project\//,
40
40
  label: 'published-template-surface',
41
41
  },
42
42
  ];
@@ -44,47 +44,47 @@ const SHARED_IMPACT_PATTERNS = [
44
44
  const MIRROR_PAIRS = [
45
45
  {
46
46
  source: 'src/index/buildIndex.js',
47
- mirror: 'templates/.claude/ukit/index/lib/index-core.mjs',
47
+ mirror: 'template_project/.claude/ukit/index/lib/index-core.mjs',
48
48
  reason: 'installed index-core mirror embeds source index behavior',
49
49
  },
50
50
  {
51
51
  source: 'src/index/queryIndex.js',
52
- mirror: 'templates/.claude/ukit/index/lib/index-core.mjs',
52
+ mirror: 'template_project/.claude/ukit/index/lib/index-core.mjs',
53
53
  reason: 'installed index-core mirror embeds source query behavior',
54
54
  },
55
55
  {
56
56
  source: 'src/index/resolveContext.js',
57
- mirror: 'templates/.claude/ukit/index/lib/index-core.mjs',
57
+ mirror: 'template_project/.claude/ukit/index/lib/index-core.mjs',
58
58
  reason: 'installed index-core mirror embeds context resolution behavior',
59
59
  },
60
60
  {
61
61
  source: 'src/index/verificationPlan.js',
62
- mirror: 'templates/.claude/ukit/index/lib/index-core.mjs',
62
+ mirror: 'template_project/.claude/ukit/index/lib/index-core.mjs',
63
63
  reason: 'installed index-core mirror embeds verification planning behavior',
64
64
  },
65
65
  {
66
66
  source: 'src/index/taskRouting.js',
67
- mirror: 'templates/.claude/ukit/index/route-task.mjs',
67
+ mirror: 'template_project/.claude/ukit/index/route-task.mjs',
68
68
  reason: 'installed route-task helper mirrors source task routing behavior',
69
69
  },
70
70
  {
71
71
  source: 'src/index/routeCatalog.js',
72
- mirror: 'templates/.claude/ukit/index/route-catalog.mjs',
72
+ mirror: 'template_project/.claude/ukit/index/route-catalog.mjs',
73
73
  reason: 'installed route catalog must match source route catalog',
74
74
  },
75
75
  {
76
76
  source: 'src/core/output/index.js',
77
- mirror: 'templates/.claude/ukit/runtime/output-compression.mjs',
77
+ mirror: 'template_project/.claude/ukit/runtime/output-compression.mjs',
78
78
  reason: 'source output compression runtime should stay aligned with installed hook runtime',
79
79
  },
80
80
  {
81
81
  source: 'src/core/token/index.js',
82
- mirror: 'templates/.claude/ukit/runtime/token-utils.mjs',
82
+ mirror: 'template_project/.claude/ukit/runtime/token-utils.mjs',
83
83
  reason: 'source token runtime should stay aligned with installed token utilities',
84
84
  },
85
85
  {
86
86
  source: 'src/core/compact/threshold.js',
87
- mirror: 'templates/.claude/ukit/runtime/compact-threshold.mjs',
87
+ mirror: 'template_project/.claude/ukit/runtime/compact-threshold.mjs',
88
88
  reason: 'source compact threshold runtime should stay aligned with installed compact threshold hook',
89
89
  },
90
90
  ];