@routinecrew/routinecode 2.31.63 → 2.31.67

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 (325) hide show
  1. package/bin/cli.sh +7 -0
  2. package/bin/prompt-vault.js +1 -1
  3. package/bin/rc-config.js +2 -0
  4. package/bin/rc-credit-turn.js +1 -218
  5. package/bin/rc-grant.js +1 -78
  6. package/bin/rc-team.js +1 -591
  7. package/bin/seal-open.js +1 -1
  8. package/hooks/architect-runner.sh +159 -0
  9. package/hooks/cc-compat-watch.js +1 -70
  10. package/hooks/hooks-config.json +18 -0
  11. package/hooks/lib/cc-surface.json +2 -2
  12. package/hooks/lib/config_bash_track.py +390 -0
  13. package/hooks/lib/config_guard.py +103 -0
  14. package/hooks/lib/emit_raw.py +11 -1
  15. package/hooks/lib/known_solution.py +1 -1
  16. package/hooks/lib/sync_manager.py +96 -1
  17. package/hooks/lib/tests/test_config_bash_track.py +189 -0
  18. package/hooks/lib/tests/test_maintenance_sync.py +190 -0
  19. package/hooks/maintenance-runner.sh +450 -0
  20. package/hooks/pending-drainer.sh +12 -7
  21. package/hooks/post-agent-return.sh +1 -1
  22. package/hooks/post-bash-knowledge.sh +2 -2
  23. package/hooks/post-bash-verify.sh +28 -3
  24. package/hooks/post-build-check.sh +5 -5
  25. package/hooks/post-delegation-nudge.sh +1 -1
  26. package/hooks/post-domain-knowledge-record.sh +1 -1
  27. package/hooks/post-edit-track.sh +26 -1
  28. package/hooks/post-knowledge-query.sh +2 -2
  29. package/hooks/pre-agent-briefing.sh +16 -0
  30. package/hooks/pre-agent-spawn.mjs +1 -1
  31. package/hooks/pre-bash-guard.sh +19 -0
  32. package/hooks/pre-edit-config-gate.sh +16 -0
  33. package/hooks/pre-edit-domain-gate.sh +5 -5
  34. package/hooks/pre-edit-guard.sh +9 -0
  35. package/hooks/pre-edit-knowledge-gate.sh +2 -2
  36. package/hooks/pre-maintenance-guard.sh +48 -0
  37. package/hooks/pre-read-knowledge-inject.sh +1 -1
  38. package/hooks/pre-secret-guard.sh +1 -1
  39. package/hooks/recorder-runner.sh +16 -1
  40. package/hooks/save-user-message.sh +1 -1
  41. package/hooks/session-start.sh +69 -7
  42. package/hooks/stop-claim-check.sh +1 -1
  43. package/hooks/stop-claim-check.v3.sh +107 -1
  44. package/hooks/stop-knowledge-remind.sh +2 -2
  45. package/hooks/user-prompt-submit.sh +23 -7
  46. package/mcp-db-manager/dist/analyzers/duplicate-detector.js +1 -1
  47. package/mcp-db-manager/dist/core/model-parser.js +1 -1
  48. package/mcp-db-manager/dist/core/schema-reader.js +1 -1
  49. package/mcp-db-manager/dist/executors/migration-executor.js +1 -1
  50. package/mcp-db-manager/dist/generators/migration-generator.js +1 -1
  51. package/mcp-db-manager/dist/index.js +1 -1
  52. package/mcp-db-manager/dist/validators/schema-validator.js +1 -1
  53. package/mcp-dev-tester/dist/analyzers/auth-diagnoser.js +1 -1
  54. package/mcp-dev-tester/dist/analyzers/backend-analyzer.js +1 -1
  55. package/mcp-dev-tester/dist/analyzers/endpoint-diagnoser.js +1 -1
  56. package/mcp-dev-tester/dist/analyzers/frontend-analyzer.js +1 -1
  57. package/mcp-dev-tester/dist/analyzers/runtime-diagnoser.js +1 -1
  58. package/mcp-dev-tester/dist/analyzers/type-comparator.js +1 -1
  59. package/mcp-dev-tester/dist/analyzers/validation-diagnoser.js +1 -1
  60. package/mcp-dev-tester/dist/attestation.js +1 -1
  61. package/mcp-dev-tester/dist/browser/playwright-manager.js +1 -1
  62. package/mcp-dev-tester/dist/browser/ui-tester.js +1 -1
  63. package/mcp-dev-tester/dist/config/project-config.js +1 -1
  64. package/mcp-dev-tester/dist/index.js +1 -1
  65. package/mcp-dev-tester/dist/testers/api-tester.js +1 -1
  66. package/mcp-doc-fetcher/dist/index.js +1 -1
  67. package/mcp-html-renderer/dist/index.js +1 -1
  68. package/mcp-html-renderer/dist/preview.js +1 -1
  69. package/mcp-html-renderer/dist/template-engine.js +1 -1
  70. package/mcp-intelligence/dist/concept-catalog.js +1 -1
  71. package/mcp-intelligence/dist/concept-server-proxy.js +1 -1
  72. package/mcp-intelligence/dist/config-auth.js +1 -1
  73. package/mcp-intelligence/dist/contracts.generated.js +1 -1
  74. package/mcp-intelligence/dist/domain-templates.js +1 -1
  75. package/mcp-intelligence/dist/grounding.js +1 -1
  76. package/mcp-intelligence/dist/handlers.js +1 -1
  77. package/mcp-intelligence/dist/index.js +1 -1
  78. package/mcp-intelligence/dist/intelligence-file.js +1 -1
  79. package/mcp-intelligence/dist/knowledge-critic.js +1 -1
  80. package/mcp-intelligence/dist/knowledge-handlers.js +1 -1
  81. package/mcp-intelligence/dist/mention-extractor.js +1 -1
  82. package/mcp-intelligence/dist/provenance.js +1 -1
  83. package/mcp-intelligence/dist/semantic-embedder.js +1 -1
  84. package/mcp-log-watcher/dist/config-auth.js +1 -1
  85. package/mcp-log-watcher/dist/file-watcher.js +1 -1
  86. package/mcp-log-watcher/dist/index.js +1 -1
  87. package/mcp-log-watcher/dist/known-solutions.js +1 -1
  88. package/mcp-log-watcher/dist/log-store.js +1 -1
  89. package/mcp-log-watcher/dist/websocket-server.js +1 -1
  90. package/mcp-plan-manager/dist/__tests__/file-ops-knowledge-dir.test.js +1 -0
  91. package/mcp-plan-manager/dist/__tests__/plan-parser.test.js +1 -1
  92. package/mcp-plan-manager/dist/file-ops.js +1 -1
  93. package/mcp-plan-manager/dist/index.js +1 -1
  94. package/mcp-plan-manager/dist/plan-parser.js +1 -1
  95. package/mcp-project-context/dist/git-ops.js +1 -1
  96. package/mcp-project-context/dist/index.js +1 -1
  97. package/mcp-project-context/dist/project-analysis.js +1 -1
  98. package/mcp-routinecode/dist/agent-tracker.js +1 -1
  99. package/mcp-routinecode/dist/attestation.js +1 -1
  100. package/mcp-routinecode/dist/blast-radius.js +1 -1
  101. package/mcp-routinecode/dist/changeset.js +1 -1
  102. package/mcp-routinecode/dist/config-auth.js +1 -1
  103. package/mcp-routinecode/dist/config-map/arch-graph.js +1 -0
  104. package/mcp-routinecode/dist/config-map/architect-store.js +1 -0
  105. package/mcp-routinecode/dist/config-map/assign.js +1 -0
  106. package/mcp-routinecode/dist/config-map/audit-cli.js +1 -0
  107. package/mcp-routinecode/dist/config-map/audit.js +1 -0
  108. package/mcp-routinecode/dist/config-map/briefing.js +1 -0
  109. package/mcp-routinecode/dist/config-map/decisions.js +1 -0
  110. package/mcp-routinecode/dist/config-map/decls.js +1 -0
  111. package/mcp-routinecode/dist/config-map/extract.js +1 -0
  112. package/mcp-routinecode/dist/config-map/gate.js +1 -0
  113. package/mcp-routinecode/dist/config-map/hash.js +1 -0
  114. package/mcp-routinecode/dist/config-map/ident-norm.js +1 -0
  115. package/mcp-routinecode/dist/config-map/index-store.js +1 -0
  116. package/mcp-routinecode/dist/config-map/light-eval.js +1 -0
  117. package/mcp-routinecode/dist/config-map/link.js +1 -0
  118. package/mcp-routinecode/dist/config-map/lookup.js +1 -0
  119. package/mcp-routinecode/dist/config-map/louvain.js +1 -0
  120. package/mcp-routinecode/dist/config-map/maintenance-cli.js +1 -0
  121. package/mcp-routinecode/dist/config-map/names.js +1 -0
  122. package/mcp-routinecode/dist/config-map/proposals.js +1 -0
  123. package/mcp-routinecode/dist/config-map/recheck.js +1 -0
  124. package/mcp-routinecode/dist/config-map/repo-id.js +1 -0
  125. package/mcp-routinecode/dist/config-map/rule-import.js +1 -0
  126. package/mcp-routinecode/dist/config-map/scc.js +1 -0
  127. package/mcp-routinecode/dist/config-map/shape-eval.js +1 -0
  128. package/mcp-routinecode/dist/config-map/shape.js +1 -0
  129. package/mcp-routinecode/dist/config-map/snapshot.js +1 -0
  130. package/mcp-routinecode/dist/config-map/stable-id.js +1 -0
  131. package/mcp-routinecode/dist/config-map/store.js +1 -0
  132. package/mcp-routinecode/dist/config-map/task-eval.js +1 -0
  133. package/mcp-routinecode/dist/config-map/templates.js +1 -0
  134. package/mcp-routinecode/dist/config-map/types.js +1 -0
  135. package/mcp-routinecode/dist/contracts.generated.js +1 -1
  136. package/mcp-routinecode/dist/coverage.js +1 -1
  137. package/mcp-routinecode/dist/explorer-advisor.js +1 -1
  138. package/mcp-routinecode/dist/failure-tracker.js +1 -1
  139. package/mcp-routinecode/dist/file-lock-registry.js +1 -1
  140. package/mcp-routinecode/dist/file-risk-scorer.js +1 -1
  141. package/mcp-routinecode/dist/index.js +1 -1
  142. package/mcp-routinecode/dist/known-solutions.js +1 -1
  143. package/mcp-routinecode/dist/ledger-miner.js +1 -1
  144. package/mcp-routinecode/dist/observed-draft.js +1 -1
  145. package/mcp-routinecode/dist/pattern-matcher.js +1 -1
  146. package/mcp-routinecode/dist/route-match.js +1 -1
  147. package/mcp-routinecode/dist/routines.js +1 -1
  148. package/mcp-routinecode/dist/rule-engine.js +1 -1
  149. package/mcp-routinecode/dist/rule-promoter.js +1 -1
  150. package/mcp-routinecode/dist/telemetry-analyzer.js +1 -1
  151. package/mcp-routinecode/dist/test-runner.js +1 -1
  152. package/mcp-routinecode/dist/verification.js +0 -0
  153. package/mcp-routinecode/dist/viral-loop.js +1 -1
  154. package/mcp-routinecode/package.json +3 -1
  155. package/package.json +3 -2
  156. package/plugin/agents/analyzer.md.sealed +1 -0
  157. package/plugin/agents/architect.md.sealed +1 -0
  158. package/plugin/agents/crawler.md.sealed +1 -0
  159. package/plugin/agents/explorer.md.sealed +1 -0
  160. package/plugin/agents/implementor.md.sealed +1 -0
  161. package/plugin/agents/looker.md.sealed +1 -0
  162. package/plugin/agents/planner.md.sealed +1 -0
  163. package/plugin/agents/recorder.md.sealed +1 -0
  164. package/plugin/agents/reviewer.md.sealed +1 -0
  165. package/plugin/agents/verifier.md.sealed +1 -0
  166. package/plugin/commands/analyze.md.sealed +1 -0
  167. package/plugin/commands/plan.md.sealed +1 -0
  168. package/plugin/commands/rc.md.sealed +1 -0
  169. package/plugin/commands/receipt.md.sealed +1 -0
  170. package/plugin/commands/recharge.md.sealed +1 -0
  171. package/plugin/commands/routines.md.sealed +1 -0
  172. package/plugin/commands/share.md.sealed +1 -0
  173. package/plugin/routinecode-prompt.md.sealed +1 -0
  174. package/hooks/tests/cd-bypass.test.py +0 -57
  175. package/hooks/tests/design09-client.test.py +0 -471
  176. package/hooks/tests/dev-mode.test.py +0 -62
  177. package/hooks/tests/gate-integration.test.sh +0 -300
  178. package/hooks/tests/in-project-relax.test.py +0 -106
  179. package/hooks/tests/knowledge-loop.test.sh +0 -89
  180. package/hooks/tests/ledger-bench.sh +0 -115
  181. package/hooks/tests/ledger-chaos.test.sh +0 -185
  182. package/hooks/tests/ledger-compat.test.sh +0 -138
  183. package/hooks/tests/ledger-integration.test.sh +0 -200
  184. package/hooks/tests/ledger-unit.test.sh +0 -300
  185. package/hooks/tests/mcp-name-wiring.test.sh +0 -64
  186. package/hooks/tests/rm-guard.test.py +0 -108
  187. package/hooks/tests/secret-guard-bypass.test.sh +0 -107
  188. package/hooks/tests/secret-guard.test.sh +0 -604
  189. package/hooks/tests/secret-premask.test.py +0 -179
  190. package/hooks/tests/stop-autoproceed.test.sh +0 -60
  191. package/hooks/tests/stop-claim-check-v3-sim.sh +0 -224
  192. package/hooks/tests/stop-claim-check-v3.test.sh +0 -373
  193. package/hooks/tests/stop-claim-check.test.sh +0 -224
  194. package/mcp-db-manager/dist/analyzers/duplicate-detector.d.ts +0 -48
  195. package/mcp-db-manager/dist/analyzers/duplicate-detector.d.ts.map +0 -1
  196. package/mcp-db-manager/dist/core/model-parser.d.ts +0 -71
  197. package/mcp-db-manager/dist/core/model-parser.d.ts.map +0 -1
  198. package/mcp-db-manager/dist/core/schema-reader.d.ts +0 -69
  199. package/mcp-db-manager/dist/core/schema-reader.d.ts.map +0 -1
  200. package/mcp-db-manager/dist/executors/migration-executor.d.ts +0 -14
  201. package/mcp-db-manager/dist/executors/migration-executor.d.ts.map +0 -1
  202. package/mcp-db-manager/dist/generators/migration-generator.d.ts +0 -69
  203. package/mcp-db-manager/dist/generators/migration-generator.d.ts.map +0 -1
  204. package/mcp-db-manager/dist/index.d.ts +0 -7
  205. package/mcp-db-manager/dist/index.d.ts.map +0 -1
  206. package/mcp-db-manager/dist/types.d.ts +0 -382
  207. package/mcp-db-manager/dist/types.d.ts.map +0 -1
  208. package/mcp-db-manager/dist/validators/schema-validator.d.ts +0 -56
  209. package/mcp-db-manager/dist/validators/schema-validator.d.ts.map +0 -1
  210. package/mcp-dev-tester/dist/analyzers/auth-diagnoser.d.ts +0 -15
  211. package/mcp-dev-tester/dist/analyzers/auth-diagnoser.d.ts.map +0 -1
  212. package/mcp-dev-tester/dist/analyzers/backend-analyzer.d.ts +0 -18
  213. package/mcp-dev-tester/dist/analyzers/backend-analyzer.d.ts.map +0 -1
  214. package/mcp-dev-tester/dist/analyzers/endpoint-diagnoser.d.ts +0 -15
  215. package/mcp-dev-tester/dist/analyzers/endpoint-diagnoser.d.ts.map +0 -1
  216. package/mcp-dev-tester/dist/analyzers/frontend-analyzer.d.ts +0 -15
  217. package/mcp-dev-tester/dist/analyzers/frontend-analyzer.d.ts.map +0 -1
  218. package/mcp-dev-tester/dist/analyzers/runtime-diagnoser.d.ts +0 -15
  219. package/mcp-dev-tester/dist/analyzers/runtime-diagnoser.d.ts.map +0 -1
  220. package/mcp-dev-tester/dist/analyzers/type-comparator.d.ts +0 -15
  221. package/mcp-dev-tester/dist/analyzers/type-comparator.d.ts.map +0 -1
  222. package/mcp-dev-tester/dist/analyzers/validation-diagnoser.d.ts +0 -15
  223. package/mcp-dev-tester/dist/analyzers/validation-diagnoser.d.ts.map +0 -1
  224. package/mcp-dev-tester/dist/attestation.d.ts +0 -36
  225. package/mcp-dev-tester/dist/attestation.d.ts.map +0 -1
  226. package/mcp-dev-tester/dist/browser/playwright-manager.d.ts +0 -148
  227. package/mcp-dev-tester/dist/browser/playwright-manager.d.ts.map +0 -1
  228. package/mcp-dev-tester/dist/browser/ui-tester.d.ts +0 -28
  229. package/mcp-dev-tester/dist/browser/ui-tester.d.ts.map +0 -1
  230. package/mcp-dev-tester/dist/config/project-config.d.ts +0 -94
  231. package/mcp-dev-tester/dist/config/project-config.d.ts.map +0 -1
  232. package/mcp-dev-tester/dist/index.d.ts +0 -3
  233. package/mcp-dev-tester/dist/index.d.ts.map +0 -1
  234. package/mcp-dev-tester/dist/testers/api-tester.d.ts +0 -77
  235. package/mcp-dev-tester/dist/testers/api-tester.d.ts.map +0 -1
  236. package/mcp-dev-tester/dist/types.d.ts +0 -423
  237. package/mcp-dev-tester/dist/types.d.ts.map +0 -1
  238. package/mcp-doc-fetcher/dist/index.d.ts +0 -17
  239. package/mcp-doc-fetcher/dist/index.d.ts.map +0 -1
  240. package/mcp-html-renderer/dist/index.d.ts +0 -3
  241. package/mcp-html-renderer/dist/index.d.ts.map +0 -1
  242. package/mcp-html-renderer/dist/preview.d.ts +0 -15
  243. package/mcp-html-renderer/dist/preview.d.ts.map +0 -1
  244. package/mcp-html-renderer/dist/template-engine.d.ts +0 -46
  245. package/mcp-html-renderer/dist/template-engine.d.ts.map +0 -1
  246. package/mcp-intelligence/dist/concept-catalog.d.ts +0 -142
  247. package/mcp-intelligence/dist/concept-catalog.d.ts.map +0 -1
  248. package/mcp-intelligence/dist/concept-server-proxy.d.ts +0 -38
  249. package/mcp-intelligence/dist/concept-server-proxy.d.ts.map +0 -1
  250. package/mcp-intelligence/dist/config-auth.d.ts +0 -18
  251. package/mcp-intelligence/dist/config-auth.d.ts.map +0 -1
  252. package/mcp-intelligence/dist/contracts.generated.d.ts +0 -58
  253. package/mcp-intelligence/dist/contracts.generated.d.ts.map +0 -1
  254. package/mcp-intelligence/dist/domain-templates.d.ts +0 -25
  255. package/mcp-intelligence/dist/domain-templates.d.ts.map +0 -1
  256. package/mcp-intelligence/dist/grounding.d.ts +0 -77
  257. package/mcp-intelligence/dist/grounding.d.ts.map +0 -1
  258. package/mcp-intelligence/dist/handlers.d.ts +0 -72
  259. package/mcp-intelligence/dist/handlers.d.ts.map +0 -1
  260. package/mcp-intelligence/dist/index.d.ts +0 -3
  261. package/mcp-intelligence/dist/index.d.ts.map +0 -1
  262. package/mcp-intelligence/dist/intelligence-file.d.ts +0 -82
  263. package/mcp-intelligence/dist/intelligence-file.d.ts.map +0 -1
  264. package/mcp-intelligence/dist/knowledge-critic.d.ts +0 -28
  265. package/mcp-intelligence/dist/knowledge-critic.d.ts.map +0 -1
  266. package/mcp-intelligence/dist/knowledge-handlers.d.ts +0 -358
  267. package/mcp-intelligence/dist/knowledge-handlers.d.ts.map +0 -1
  268. package/mcp-intelligence/dist/mention-extractor.d.ts +0 -13
  269. package/mcp-intelligence/dist/mention-extractor.d.ts.map +0 -1
  270. package/mcp-intelligence/dist/provenance.d.ts +0 -28
  271. package/mcp-intelligence/dist/provenance.d.ts.map +0 -1
  272. package/mcp-intelligence/dist/semantic-embedder.d.ts +0 -25
  273. package/mcp-intelligence/dist/semantic-embedder.d.ts.map +0 -1
  274. package/mcp-log-watcher/dist/config-auth.d.ts +0 -16
  275. package/mcp-log-watcher/dist/config-auth.d.ts.map +0 -1
  276. package/mcp-log-watcher/dist/file-watcher.d.ts +0 -36
  277. package/mcp-log-watcher/dist/file-watcher.d.ts.map +0 -1
  278. package/mcp-log-watcher/dist/index.d.ts +0 -3
  279. package/mcp-log-watcher/dist/index.d.ts.map +0 -1
  280. package/mcp-log-watcher/dist/known-solutions.d.ts +0 -60
  281. package/mcp-log-watcher/dist/known-solutions.d.ts.map +0 -1
  282. package/mcp-log-watcher/dist/log-store.d.ts +0 -72
  283. package/mcp-log-watcher/dist/log-store.d.ts.map +0 -1
  284. package/mcp-log-watcher/dist/types.d.ts +0 -52
  285. package/mcp-log-watcher/dist/types.d.ts.map +0 -1
  286. package/mcp-log-watcher/dist/websocket-server.d.ts +0 -44
  287. package/mcp-log-watcher/dist/websocket-server.d.ts.map +0 -1
  288. package/mcp-plan-manager/dist/__tests__/plan-parser.test.d.ts +0 -7
  289. package/mcp-plan-manager/dist/__tests__/plan-parser.test.d.ts.map +0 -1
  290. package/mcp-plan-manager/dist/file-ops.d.ts +0 -39
  291. package/mcp-plan-manager/dist/file-ops.d.ts.map +0 -1
  292. package/mcp-plan-manager/dist/index.d.ts +0 -23
  293. package/mcp-plan-manager/dist/index.d.ts.map +0 -1
  294. package/mcp-plan-manager/dist/plan-parser.d.ts +0 -76
  295. package/mcp-plan-manager/dist/plan-parser.d.ts.map +0 -1
  296. package/mcp-project-context/dist/git-ops.d.ts +0 -40
  297. package/mcp-project-context/dist/git-ops.d.ts.map +0 -1
  298. package/mcp-project-context/dist/index.d.ts +0 -20
  299. package/mcp-project-context/dist/index.d.ts.map +0 -1
  300. package/mcp-project-context/dist/project-analysis.d.ts +0 -50
  301. package/mcp-project-context/dist/project-analysis.d.ts.map +0 -1
  302. package/mcp-routinecode/dist/agent-tracker.d.ts +0 -68
  303. package/mcp-routinecode/dist/attestation.d.ts +0 -37
  304. package/mcp-routinecode/dist/blast-radius.d.ts +0 -83
  305. package/mcp-routinecode/dist/changeset.d.ts +0 -86
  306. package/mcp-routinecode/dist/config-auth.d.ts +0 -15
  307. package/mcp-routinecode/dist/contracts.generated.d.ts +0 -57
  308. package/mcp-routinecode/dist/coverage.d.ts +0 -49
  309. package/mcp-routinecode/dist/explorer-advisor.d.ts +0 -34
  310. package/mcp-routinecode/dist/failure-tracker.d.ts +0 -32
  311. package/mcp-routinecode/dist/file-lock-registry.d.ts +0 -31
  312. package/mcp-routinecode/dist/file-risk-scorer.d.ts +0 -27
  313. package/mcp-routinecode/dist/index.d.ts +0 -13
  314. package/mcp-routinecode/dist/known-solutions.d.ts +0 -57
  315. package/mcp-routinecode/dist/ledger-miner.d.ts +0 -19
  316. package/mcp-routinecode/dist/observed-draft.d.ts +0 -42
  317. package/mcp-routinecode/dist/pattern-matcher.d.ts +0 -14
  318. package/mcp-routinecode/dist/route-match.d.ts +0 -24
  319. package/mcp-routinecode/dist/routines.d.ts +0 -59
  320. package/mcp-routinecode/dist/rule-engine.d.ts +0 -53
  321. package/mcp-routinecode/dist/rule-promoter.d.ts +0 -22
  322. package/mcp-routinecode/dist/telemetry-analyzer.d.ts +0 -56
  323. package/mcp-routinecode/dist/test-runner.d.ts +0 -66
  324. package/mcp-routinecode/dist/verification.d.ts +0 -173
  325. package/mcp-routinecode/dist/viral-loop.d.ts +0 -227
@@ -1,86 +0,0 @@
1
- /**
2
- * Change Set — 태스크 창의 변경 파일·변경 라인 (채점·커버리지·라우트 대조 공용).
3
- *
4
- * 출처는 훅이 생산한 edit-tracker(완료 시 reset) + git. LLM 신고 목록은 git dirty 로
5
- * 확인된 것만 보충한다.
6
- */
7
- /**
8
- * 변경 감지용 git 호출은 저장소 설정의 감지 최적화를 끈다 — fsmonitor(가짜 훅이 "변경 없음" 보고)·
9
- * trustctime=false·checkStat·ignoreStat·untrackedCache 로 git status 를 속여 변경을 숨기는 것 차단.
10
- * ⚠️ hooks/lib/attest_reader.py GIT_SAFE 와 동일 유지.
11
- */
12
- export declare const GIT_SAFE: string[];
13
- export declare const ROOT_MARKERS: string[];
14
- export declare const CODE_EXT_RE: RegExp;
15
- export declare const JS_FAMILY_RE: RegExp;
16
- export declare const TEST_FILE_RE: RegExp;
17
- export declare function relatedDir(a: string | null, b: string | null): boolean;
18
- export declare function resolveFile(f: string, projectDir: string): string;
19
- export declare function isGitDirty(file: string): boolean;
20
- /** 마지막 완료(mark_task_complete 허용) 시각 — completions.jsonl 마지막 행 */
21
- export declare function lastCompletionMs(): number;
22
- /**
23
- * 태스크 창 시작 = max(마지막 완료, now - 창 상한).
24
- * 완료 처리 없이 tracker 가 누적되면(다른 태스크·세션 편집 혼입) 변경 집합이 오염되므로 상한을 둔다.
25
- */
26
- export declare function taskWindowStartMs(now?: number): number;
27
- /**
28
- * 태스크 창 안에서 편집된 파일. 편집 시각(ts)이 있으면 창 기준, 없는 구형 항목은
29
- * git dirty(또는 git 밖이라 판정 불가)일 때만 포함.
30
- */
31
- export declare function trackedFiles(): string[];
32
- /** 코드포인트(=UTF-8 바이트) 순 정렬 — Python sorted() 와 동일 순서 (JS 기본 sort 는 UTF-16 단위) */
33
- export declare function cpSort(xs: string[]): string[];
34
- /**
35
- * 변경 지문 — tracker 파일이 속한 레포들의 dirty(추적+미추적) 파일 내용 해시 + git 밖 tracker 파일 해시.
36
- * 채점 시 서명해 두고 hook 이 다시 계산해 비교 → 채점 이후 Bash 편집(tracker 미기록)도 stale 로 잡는다.
37
- * ⚠️ hooks/lib/attest_reader.py change_fingerprint 와 바이트 동일 알고리즘.
38
- */
39
- export declare const STATUS_CAP_BYTES: number;
40
- /** git index 플래그(assume-unchanged / skip-worktree)로 status 에서 숨겨진 추적 파일 (레포 상대경로) */
41
- export declare function hiddenByIndexFlags(top: string): string[];
42
- /** 직전 changeFingerprint 계산에서 git status 가 상한을 넘은 레포 (변경 감지 불가 → 경고/차단 근거) */
43
- export declare let lastOversizeRepos: string[];
44
- /** 직전 changeFingerprint 에서 작업 트리가 다른 곳으로 돌려진(core.worktree) 레포 안의 파일 */
45
- export declare let lastRedirectFiles: string[];
46
- /** 설정값 그대로 읽기 (GIT_SAFE 의 -c 오버라이드 없이 — 실제 저장소 설정 확인용) */
47
- export declare function gitConfigRaw(key: string, cwd: string): string;
48
- /**
49
- * 파일이 속한 레포 루트 — 단 core.worktree 로 작업 트리를 다른 곳(깨끗한 사본)에 돌려놓았거나
50
- * 파일이 그 루트 밖이면 null (git 이 실제 파일을 보지 않으므로 레포 밖처럼 원본 내용 해시로 취급).
51
- */
52
- export declare function repoTopFor(file: string): string | null;
53
- /**
54
- * 파일의 git 상태 귀속:
55
- * - repo: git 의 작업 트리(show-toplevel)가 실제로 이 파일을 포함 (서브모듈 포함 — core.worktree 가 있어도 포함하면 정상)
56
- * - redirect: 레포 안인데 작업 트리가 다른 곳을 가리킴(core.worktree 로 깨끗한 사본) → 변경 검증 불가, hook 차단
57
- * - outside: git 밖
58
- */
59
- export declare function repoOf(file: string): {
60
- kind: 'repo' | 'redirect' | 'outside';
61
- top: string | null;
62
- };
63
- /** clean/smudge filter 속성이 붙은 추적 파일 — filter 가 status 에 보일 내용을 바꿀 수 있어 원본 내용을 직접 해시 */
64
- export declare function filteredFiles(top: string): string[];
65
- /** 감지 우회에 쓰일 수 있는 저장소 로컬 설정 지문: .git/config · info/attributes · refs/replace */
66
- export declare function repoConfigHash(top: string): string;
67
- export declare function changeFingerprint(files?: string[]): string;
68
- /** 지문 원문 항목 (정렬됨) — 진단·TS/Python 대조용 */
69
- export declare function fingerprintEntries(files?: string[]): string[];
70
- /** 태스크 창 시작 시점에 post-edit-track 이 기록한 레포 HEAD sha (없으면 null) */
71
- export declare function taskStartHead(dir: string): string | null;
72
- /** tracker 에 기록된 편집 시각 중 가장 이른 것 (태스크 창 안의 첫 편집) — 없으면 null */
73
- export declare function firstEditMs(files: string[]): number | null;
74
- export declare function attestedChangedFiles(projectDir: string, reported?: string[]): {
75
- files: string[];
76
- fromTracker: number;
77
- fromGit: number;
78
- rejected: number;
79
- };
80
- /** 변경 파일이 속한 가장 가까운 패키지 루트 (없으면 null) */
81
- export declare function packageRoot(file: string): string | null;
82
- /**
83
- * HEAD 대비 변경(추가·수정)된 라인 번호(1-based).
84
- * 미추적(신규) 파일 = 전체 라인. git 밖 파일 = null (라인 단위 판정 불가).
85
- */
86
- export declare function changedLines(file: string): number[] | null;
@@ -1,15 +0,0 @@
1
- /**
2
- * config-auth — 서버 인증 실패(401) 자가치유 (05 §8 point 2, W0').
3
- * mcp-intelligence/src/config-auth.ts의 미러 (패키지 경계로 공유 불가, 동작 패리티 유지).
4
- *
5
- * 401 응답을 받으면 ~/.routinecode/auth-failure 마커를 write한다. session-start가
6
- * 이 마커를 소비해 POST /api-keys/verify로 키 실유효를 검증한 뒤, 무효일 때만
7
- * apiKey를 삭제하고 재프로비저닝한다(05 §8 point 3). 즉시 삭제하지 않는 이유:
8
- * 일시적·오배선 401이 유효한 키를 파괴하는 것을 막기 위함(회복 배선의 안전판).
9
- * 403은 권한 문제(만료 아님)일 수 있어 마커를 쓰지 않는다. 5xx/네트워크 실패도 제외.
10
- */
11
- /**
12
- * 서버 응답이 401이면 auth-failure 마커를 write한다. 그 외 상태는 no-op.
13
- * 마커 쓰기 실패는 조용히 무시 (fail-open).
14
- */
15
- export declare function noteAuthFailure(status: number): void;
@@ -1,57 +0,0 @@
1
- /**
2
- * knowledge-contracts — 지식 계층의 단일 정본(canonical).
3
- *
4
- * 두 MCP 서버(mcp-intelligence, mcp-routinecode)가 파일(jsonl) 포맷으로만 결합돼
5
- * 있어 배선이 끊겨도 컴파일러가 못 잡던 문제를 없앤다. 경로·sourceId 규칙·denotes
6
- * 스키마·리더를 여기 한 곳에 두고, 양쪽 서버가 이 파일의 복사본을 import 한다.
7
- *
8
- * ⚠️ 이 파일이 정본이다. 각 서버의 `src/contracts.generated.ts`는 빌드 시
9
- * `scripts/sync-contracts.mjs`가 복사한 것 — 직접 수정하지 마라.
10
- */
11
- export declare function knowledgeDir(): string;
12
- export declare function knowledgePath(fileName: string): string;
13
- /** 지식 파일명 정본. */
14
- export declare const FILES: {
15
- readonly EVENTS: "events.jsonl";
16
- readonly PATTERNS: "patterns.jsonl";
17
- readonly QUIRKS: "quirks.jsonl";
18
- readonly DOMAIN_KNOWLEDGE: "domain-knowledge.jsonl";
19
- readonly DECISIONS: "decisions.jsonl";
20
- readonly CONCEPTS: "concepts.jsonl";
21
- readonly DENOTES: "denotes.jsonl";
22
- readonly ASSERTIONS: "assertions.jsonl";
23
- };
24
- export declare const SOURCE: {
25
- readonly ERROR_FIX: "error-fix";
26
- readonly PATTERN: "pattern";
27
- readonly QUIRK: "quirk";
28
- readonly DOMAIN_KNOWLEDGE: "domain-knowledge";
29
- };
30
- export type SourceType = typeof SOURCE[keyof typeof SOURCE];
31
- export declare function errorFixSourceId(domain?: string, errorSignature?: string, rootCause?: string): string;
32
- export declare function patternSourceId(domain?: string, title?: string): string;
33
- export declare function quirkSourceId(library?: string, title?: string): string;
34
- export declare function domainKnowledgeSourceId(project?: string, title?: string): string;
35
- export interface DenotesRow {
36
- mentionText: string;
37
- conceptId: string;
38
- sourceType: string;
39
- sourceId: string;
40
- confidence?: number;
41
- contributorHash?: string;
42
- ts?: string;
43
- }
44
- export interface DomainKnowledgeRow {
45
- category?: string;
46
- title?: string;
47
- knowledge?: string;
48
- scope?: string[];
49
- source?: string;
50
- project?: string;
51
- tenantId?: string | number | null;
52
- }
53
- export declare function readJsonl<T>(filePath: string): T[];
54
- export declare function readDenotes(): DenotesRow[];
55
- export declare function readDomainKnowledge(): DomainKnowledgeRow[];
56
- /** conceptId 집합에 바인딩된 특정 sourceType의 sourceId들(직접 sourceId 제외). concept 경유 소환용. */
57
- export declare function relatedSourceIds(denotes: DenotesRow[], conceptIds: Set<string>, sourceType: string, excludeSourceIds: Set<string>): Set<string>;
@@ -1,49 +0,0 @@
1
- /**
2
- * Diff Coverage — "테스트가 이번에 바꾼 코드를 실제로 실행했는가".
3
- *
4
- * run_tests 가 NODE_V8_COVERAGE 로 V8 블록 커버리지를 수집하면, 변경 파일별로:
5
- * - JS(.js/.mjs/.cjs/.jsx): 스크립트 URL 이 소스 그대로 → 변경 라인 단위 판정
6
- * (라인 첫 비공백 오프셋을 감싸는 가장 좁은 range 의 count > 0 이면 실행됨)
7
- * - TS 계열: 트랜스파일로 오프셋이 어긋나므로 **함수 단위** 판정 — 변경 라인을 감싸는 함수명을
8
- * 소스에서 찾고, 같은 파일 또는 같은 패키지의 동명 JS 산출물(dist)에서 그 이름의 함수가
9
- * 실행(count>0)됐는가. 감싸는 함수가 없으면(최상위 변경) 모듈 로딩 여부로 판정.
10
- * 비 JS 언어는 측정 불가(measured=false) — 점수에 불이익 없이 경고만.
11
- */
12
- interface V8Range {
13
- startOffset: number;
14
- endOffset: number;
15
- count: number;
16
- }
17
- interface V8Function {
18
- functionName?: string;
19
- ranges: V8Range[];
20
- }
21
- export interface FileCoverage {
22
- file: string;
23
- mode: 'line' | 'function' | 'file';
24
- exercised: boolean;
25
- /** line 모드: [실행된 변경 라인, 변경 라인 수] */
26
- lines?: [number, number];
27
- /** function 모드: 변경된 함수 중 실행/미실행 */
28
- functions?: {
29
- executed: string[];
30
- missed: string[];
31
- };
32
- /** 실행 산출물(dist)이 소스보다 오래됨 — 재빌드 필요 */
33
- stale?: boolean;
34
- ratio: number;
35
- }
36
- export interface DiffCoverage {
37
- measured: boolean;
38
- ratio: number | null;
39
- files: FileCoverage[];
40
- }
41
- /** 커버리지 디렉터리의 모든 프로세스 결과를 파일 경로별로 병합 */
42
- export declare function loadV8Coverage(dir: string): Map<string, V8Function[]>;
43
- /** 변경 라인을 감싸는 함수명들 (들여쓰기 기반 근사: 위로 올라가며 더 얕은 선언 라인) */
44
- export declare function enclosingFunctionNames(src: string, lines: number[]): {
45
- names: string[];
46
- topLevel: boolean;
47
- };
48
- export declare function computeDiffCoverage(changed: string[], covDir: string): DiffCoverage;
49
- export {};
@@ -1,34 +0,0 @@
1
- /**
2
- * Explorer Advisor — Main이 explorer 호출 전 의사결정 보조.
3
- *
4
- * 3-layer escalation:
5
- * Layer 1: deterministic heuristics (rule-based, 무료/즉시)
6
- * Layer 2: telemetry lookup — 과거 유사 프롬프트의 실제 결과
7
- * Layer 3: Opus 4.6 classifier (ambiguous case 한정, 정확도 최우선)
8
- *
9
- * 출력은 recommendation + reasoning. Block하지 않고 조언만 제공.
10
- * Main이 무시할 수 있으나 reasoning이 context에 남아 판단 편향을 교정한다.
11
- */
12
- export type Recommendation = 'direct' | 'single-explorer' | 'parallel-decomposable' | 'uncertain';
13
- export interface AdviseInput {
14
- prompt: string;
15
- estimatedScope?: string;
16
- }
17
- export interface SimilarPast {
18
- count: number;
19
- avgToolCalls: number;
20
- avgTokens: number;
21
- mostCommonOutcome: 'direct' | 'explorer-light' | 'explorer-heavy';
22
- }
23
- export interface AdviseOutput {
24
- recommendation: Recommendation;
25
- confidence: number;
26
- reasoning: string[];
27
- suggestedApproach: string;
28
- layer: 1 | 2 | 3 | 0;
29
- heuristicsTriggered: string[];
30
- similarPast?: SimilarPast;
31
- modelUsed?: string;
32
- cost_usd?: number;
33
- }
34
- export declare function advise(input: AdviseInput): Promise<AdviseOutput>;
@@ -1,32 +0,0 @@
1
- /**
2
- * Failure Tracker — 3-Strike 규칙의 코드 강제
3
- *
4
- * 프롬프트 의존 대신 상태 머신으로 실패 추적.
5
- * in-memory Map + ~/.routinecode/knowledge/attempts.json 영속화 (TTL 7일).
6
- */
7
- interface Attempt {
8
- approach: string;
9
- result: 'success' | 'fail';
10
- reason?: string;
11
- ts: string;
12
- }
13
- export declare function recordAttempt(args: {
14
- issueId: string;
15
- approach: string;
16
- result: 'success' | 'fail';
17
- reason?: string;
18
- }): {
19
- attemptNumber: number;
20
- shouldEscalate: boolean;
21
- history: Attempt[];
22
- };
23
- export declare function checkEscalation(issueId: string): {
24
- totalAttempts: number;
25
- failedAttempts: number;
26
- shouldEscalate: boolean;
27
- approaches: string[];
28
- };
29
- export declare function clearAttempts(issueId: string): {
30
- cleared: boolean;
31
- };
32
- export {};
@@ -1,31 +0,0 @@
1
- /**
2
- * File Lock Registry — 병렬 에이전트 충돌 방지
3
- *
4
- * 에이전트가 작업할 파일을 선점 등록.
5
- * 다른 에이전트가 같은 파일을 수정하려 할 때 충돌 감지.
6
- * 세션 내 메모리 (MCP 서버 프로세스 수명과 동일).
7
- */
8
- export declare function lockFiles(args: {
9
- agentId: string;
10
- agentType: string;
11
- files: string[];
12
- taskDescription: string;
13
- }): {
14
- locked: boolean;
15
- conflicts: Array<{
16
- file: string;
17
- heldBy: string;
18
- taskDescription: string;
19
- }>;
20
- };
21
- export declare function releaseFiles(agentId: string): {
22
- released: number;
23
- };
24
- export declare function checkConflicts(files: string[]): {
25
- hasConflicts: boolean;
26
- conflicts: Array<{
27
- file: string;
28
- heldBy: string;
29
- since: string;
30
- }>;
31
- };
@@ -1,27 +0,0 @@
1
- /**
2
- * File Risk Scorer — 모든 축적 데이터를 파일별 risk score (0-100)로 수렴.
3
- *
4
- * 이 점수가 검증 전략, 에이전트 선택, 검증 대상 확장을 자동으로 변경한다.
5
- * 데이터 0건일 때 모든 파일은 LOW (0) → Claude Code와 동일한 행동.
6
- * 데이터가 쌓일수록 점수가 분화 → 행동이 점점 달라짐.
7
- */
8
- export type RiskLevel = 'low' | 'medium' | 'high';
9
- export interface RiskFactor {
10
- source: string;
11
- weight: number;
12
- detail: string;
13
- }
14
- export interface FileRiskScore {
15
- file: string;
16
- score: number;
17
- level: RiskLevel;
18
- factors: RiskFactor[];
19
- affectedFiles: string[];
20
- }
21
- export declare function calculateFileRisk(file: string): FileRiskScore;
22
- export declare function calculateBatchRisk(files: string[]): {
23
- files: FileRiskScore[];
24
- maxRisk: FileRiskScore | null;
25
- aggregateLevel: RiskLevel;
26
- };
27
- export declare function getAffectedFilesForVerification(files: string[]): string[];
@@ -1,13 +0,0 @@
1
- #!/usr/bin/env node
2
- /**
3
- * mcp-routinecode — RoutineCode 루틴 작업 MCP 서버
4
- *
5
- * 원자적 루틴만 노출 (토큰 0):
6
- * - build_check: 백엔드/프론트엔드 빌드 검증
7
- * - project_state: 프로젝트 현재 상태 조회
8
- * - record_attempt / check_escalation / clear_attempts: 실패 추적 상태 머신
9
- * - lock_files / release_files / check_conflicts: 에이전트 파일 충돌 방지
10
- *
11
- * v6: failure tracker + file lock registry 추가 (프롬프트 의존 -> 코드 강제)
12
- */
13
- export {};
@@ -1,57 +0,0 @@
1
- /**
2
- * known-solutions — build_check / get_errors 실패 출력에 과거 해결책을 자동 첨부한다.
3
- *
4
- * 설계: docs2/지능개선/01_phase1-소비루프-복구-설계.md (T1)
5
- * 원칙: LLM의 자발적 get_similar_errors 호출에 의존하지 않고, 에러를 감지한
6
- * 도구가 자기 출력에 KNOWN SOLUTIONS 블록을 직접 붙인다.
7
- *
8
- * 출력 계약 5원칙 (배포 훅 전수 검증으로 확정 — 위반 금지):
9
- * ① JSON 필드로만 추가 ② 실패 출력에만 첨부
10
- * ③ 첨부 텍스트 내 " → ' 치환 ④ 뒤쪽 append (앞 100/300자 파서 보호)
11
- * ⑤ sentinel 래핑 + secret-유사 문자열 금지 (fixCode 제외)
12
- *
13
- * localSimilarity 수식은 mcp-intelligence/knowledge-handlers.ts:263-266과
14
- * 동일하게 유지한다 (두 경로의 판정 일관성).
15
- */
16
- export type RetrievalKind = 'error-fix' | 'pattern' | 'quirk' | 'domain-knowledge' | 'playbook';
17
- /**
18
- * 05 §2 ③ exposure — 지식 노출 방출 (USAGE 스트림).
19
- * D1 denormalize(k_author·k_problem·k_scope)는 검색 응답 계약 확장(W2) 후 채워진다.
20
- * W1 시점엔 알 수 있는 필드(kid·kind·path)만 싣고, emit_raw 화이트리스트가 누락 키를
21
- * 자연 통과시킨다. fail-open: 방출 실패가 검색 본기능을 막지 않는다.
22
- */
23
- export declare function emitExposure(kid: string, kind: RetrievalKind, injectPath: string, extra?: {
24
- k_author?: number;
25
- k_problem?: string;
26
- k_scope?: string;
27
- }): void;
28
- export interface KnownSolution {
29
- source: 'local' | 'community';
30
- id: number | null;
31
- confidence: number;
32
- maturity: string;
33
- errorSignature: string;
34
- rootCause: string;
35
- fixApproach: string;
36
- authorUserId?: number;
37
- problemKey?: string;
38
- scope?: string;
39
- }
40
- export declare function extractErrorSignal(raw: string): string;
41
- /**
42
- * 출력용 텍스트 블록을 만든다. 결과 0건이면 빈 문자열.
43
- * 반환 문자열은 항상 sentinel로 감싸지며, 실패 출력의 **뒤쪽**에 append해야 한다.
44
- */
45
- export declare function formatBlock(solutions: KnownSolution[]): string;
46
- /**
47
- * 에러 메시지로 로컬+서버를 검색해 상위 limit건을 반환한다.
48
- * 서버는 fail-open. 로컬과 errorSignature 유사도 0.85로 dedup.
49
- */
50
- export declare function findKnownSolutions(errorMessage: string, limit?: number): Promise<KnownSolution[]>;
51
- /** community(서버) 결과의 id 목록 — T2 자동 검증 귀속용. */
52
- export declare function communityRefs(solutions: KnownSolution[]): number[];
53
- /**
54
- * community 지식 id 목록에 대해 verify(prevented)를 pending-sync 큐에 넣는다.
55
- * lock-safe append. 전송은 mcp-intelligence flushPending이 담당. draft I/O 없음.
56
- */
57
- export declare function enqueueVerify(refs: number[], project: string): number;
@@ -1,19 +0,0 @@
1
- /**
2
- * ledger-miner — 축적된 ledger 텔레메트리를 지식으로 자동 도출 (LLM 무관).
3
- *
4
- * 문제: 지식 기록(record_*)이 LLM 자발 호출에 묶여 실사용에서 안 일어남 → 지식 0건.
5
- * 반면 ledger는 code_change/analysis/commit 등 "무엇을 했는지"를 활발히 관찰·기록.
6
- * 해결: ledger를 기계적으로 마이닝해 지식을 도출한다. 첫 대상은 **co-change causal-links**
7
- * (같은 세션에서 함께 수정된 파일 쌍) — 소비자(blast-radius·file-risk-scorer)는
8
- * 있으나 배포 생산자가 없던 causal-links를 채운다.
9
- *
10
- * 한계(정직): ledger는 에러 메시지/코드 내용을 해시로 redact → rich error-fix는 못 뽑는다.
11
- * 여기서 뽑는 것은 파일 관계(구조적 지식)다. rich 지식은 별도 캡처 경로 필요.
12
- */
13
- /** ledger에서 code_change를 세션별로 모아 co-change 파일 쌍을 도출. */
14
- export declare function mineLedgerCoChanges(force?: boolean): {
15
- mined: number;
16
- pairs: number;
17
- sessions: number;
18
- skipped?: string;
19
- };
@@ -1,42 +0,0 @@
1
- /**
2
- * observed-draft — Phase 2 T4: build_check/get_errors가 "목격한" 에러 컨텍스트를
3
- * 초안으로 조립한다. errorSignature·attempts·editedFiles(git 기반)·directory는
4
- * 도구가 관찰해 채우고(LLM 수정 금지 필드), record_error_fix 시 grounding 게이트가
5
- * 이 draft를 근거로 검증한다.
6
- *
7
- * 설계: docs2/지능개선/02_phase2-수집재설계-설계.md (T4)
8
- * 핵심: sessionId를 못 받는 MCP 환경이므로 draft 키 = 프로젝트 경로 해시.
9
- */
10
- export interface ObservedDraft {
11
- draftId: string;
12
- projectHash: string;
13
- project: string;
14
- directory: string;
15
- type: 'build' | 'runtime';
16
- errorSignature: string;
17
- attempts: number;
18
- editedFiles: string[];
19
- communityRefs: number[];
20
- gitHeadAtFail: string | null;
21
- firstSeen: string;
22
- resolvedAt: string | null;
23
- }
24
- export declare function projectHash(projectDir: string): string;
25
- /**
26
- * 실패 관찰: 미해결 draft가 있으면 attempts++, 없으면 신규 생성.
27
- * communityRefs는 병합. errorSignature는 최신 관찰로 갱신.
28
- */
29
- export declare function observeFailure(args: {
30
- projectDir: string;
31
- project: string;
32
- type: 'build' | 'runtime';
33
- errorSignature: string;
34
- communityRefs: number[];
35
- }): void;
36
- /**
37
- * 성공 관찰: 미해결 draft가 있으면 resolvedAt 스탬프 + editedFiles(git diff) 산출.
38
- * 반환: 해결된 draft (없으면 null). edit-tracker.json도 갱신(기존 소비자 활성화).
39
- */
40
- export declare function observeResolution(projectDir: string): ObservedDraft | null;
41
- /** grounding 게이트(mcp-intelligence)가 draftId로 조회. */
42
- export declare function loadResolvedDraftById(draftId: string): ObservedDraft | null;
@@ -1,14 +0,0 @@
1
- /**
2
- * pattern-matcher — Phase 4 T12: 에이전트 위임 직전에 도메인 pattern/decision을
3
- * 매칭해 주입한다. pattern의 유일하게 남은 "LLM 자발 호출 의존"을 제거한다.
4
- *
5
- * 설계: docs2/지능개선/04_phase4-지식완결-세션기억-설계.md (T12·T15)
6
- * 배포 지점: mcp-routinecode track_agent_spawn 응답 (위임 전 호출이 의무인 도구).
7
- * 출력 계약: sentinel 래핑, 큰따옴표 미사용 (Phase 1과 동일 방어).
8
- */
9
- export declare function shouldInjectForAgent(agentType: string): boolean;
10
- /**
11
- * 위임 태스크에 매칭되는 pattern·decision 블록. 결과 없으면 빈 문자열.
12
- * domainHint(프로젝트명)와 taskPrompt로 매칭.
13
- */
14
- export declare function matchDelegationKnowledge(taskPrompt: string, domainHint: string): string;
@@ -1,24 +0,0 @@
1
- /**
2
- * Route ↔ Endpoint 대조 — test_endpoint 호출이 "이번에 바꾼 라우트"를 실제로 쳤는가.
3
- *
4
- * 변경된 route/router 파일(또는 변경된 controller 의 같은 디렉터리 route 파일)에서 라우트 정의를
5
- * 추출해, endpoint attestation 의 method+path 와 대조한다. 마운트 prefix(app.use('/api/v1', r))는
6
- * 정적으로 알 수 없으므로 라우트 경로를 **접미사**로 매칭한다(:id / {id} / <id> → 한 세그먼트).
7
- */
8
- export interface RouteDef {
9
- method: string;
10
- path: string;
11
- file: string;
12
- line: number;
13
- }
14
- export declare function extractRoutes(file: string, src?: string): RouteDef[];
15
- /** 리터럴 세그먼트가 하나도 없는 라우트('/', '/:id')는 마운트 prefix 미상이라 어떤 경로와도 맞아버림 → 대조 불가 */
16
- export declare function hasLiteralSegment(routePath: string): boolean;
17
- export declare function endpointMatchesRoute(method: string, endpointPath: string, r: RouteDef): boolean;
18
- /** 변경 파일 → 대조 대상 라우트. diff 에 걸린 라우트 정의가 있으면 그것만, 없으면 파일 전체 */
19
- export declare function changedRoutes(changed: string[], routeFileRe: RegExp): {
20
- routes: RouteDef[];
21
- inDiff: boolean;
22
- routeFiles: string[];
23
- unmatchable: number;
24
- };
@@ -1,59 +0,0 @@
1
- /**
2
- * 루틴 로직 -- 원자적, 결정적, 토큰 0
3
- *
4
- * v5: derive_contracts(구조 강제), diagnose_error(LLM 판단 영역) 삭제.
5
- * 남은 도구: build_check(쉘 실행), project_state(파일 존재 확인).
6
- */
7
- /**
8
- * L6: 지식 sync 건강성. pending/deadletter 파일과 .last-drain 마커를 집계.
9
- * pending=미전송 건수, oldestAgeDays=가장 오래된 pending의 경과일, deadletter=격리 건수,
10
- * lastDrainAt=마지막 drainer 실행 ISO(없으면 null).
11
- */
12
- declare function getKnowledgeSyncHealth(): {
13
- pending: number;
14
- oldestAgeDays: number;
15
- deadletter: number;
16
- lastDrainAt: string | null;
17
- };
18
- export declare function detectBuildCommand(dir: string): string | null;
19
- export declare function buildCheck(projectDir: string, projectName: string, target: string): Promise<any>;
20
- export declare function getProjectState(projectDir: string, projectName: string): Promise<{
21
- projectDir: string;
22
- projectName: string;
23
- spec: {
24
- exists: boolean;
25
- entities: string[];
26
- relations: any[];
27
- } | {
28
- exists: boolean;
29
- entities?: undefined;
30
- relations?: undefined;
31
- };
32
- contracts: {
33
- apiContract: {
34
- exists: boolean;
35
- endpoints: number;
36
- } | {
37
- exists: boolean;
38
- endpoints?: undefined;
39
- };
40
- dbSchema: {
41
- exists: boolean;
42
- };
43
- };
44
- backend: {
45
- exists: boolean;
46
- dir: string | null;
47
- };
48
- frontend: {
49
- exists: boolean;
50
- dir: string | null;
51
- };
52
- knowledgeSync: {
53
- pending: number;
54
- oldestAgeDays: number;
55
- deadletter: number;
56
- lastDrainAt: string | null;
57
- };
58
- }>;
59
- export { getKnowledgeSyncHealth };
@@ -1,53 +0,0 @@
1
- /**
2
- * Rule Engine — 승격된 규칙을 로드하고, 조건 매칭 후 행동을 반환.
3
- *
4
- * rules.jsonl은 수 건~수십 건. 즉시 로드, 계산 불필요.
5
- * 규칙이 없으면 fallback으로 raw data 기반 계산.
6
- */
7
- export type RuleType = 'verification' | 'agent' | 'strategy';
8
- export type MaturityLevel = 'observation' | 'pattern' | 'rule' | 'constraint';
9
- export interface RuleCondition {
10
- trigger_file?: string;
11
- trigger_pattern?: string;
12
- error_type?: string;
13
- min_risk?: number;
14
- }
15
- export interface VerificationAction {
16
- verify_files: string[];
17
- test_endpoints?: string[];
18
- }
19
- export interface AgentAction {
20
- prepend_agent: string;
21
- reviewer_focus?: string;
22
- }
23
- export interface StrategyAction {
24
- strategy_order: string[];
25
- }
26
- export interface ExecutionRule {
27
- id: string;
28
- type: RuleType;
29
- maturity: MaturityLevel;
30
- condition: RuleCondition;
31
- action: VerificationAction | AgentAction | StrategyAction;
32
- confidence: number;
33
- observations: number;
34
- preventions: number;
35
- last_applied?: string;
36
- created_at: string;
37
- }
38
- export declare function getMatchingRules(context: {
39
- file?: string;
40
- errorType?: string;
41
- riskScore?: number;
42
- }): ExecutionRule[];
43
- export declare function getVerificationRules(file: string): VerificationAction[];
44
- export declare function getAgentRules(file: string, riskScore?: number): AgentAction[];
45
- export declare function getStrategyRules(errorType: string): StrategyAction[];
46
- export declare function recordRuleApplication(ruleId: string, success: boolean): void;
47
- export declare function saveRules(rules: ExecutionRule[]): void;
48
- export declare function getAllRules(): ExecutionRule[];
49
- /**
50
- * rule-applications.jsonl을 소비해 rules.jsonl의 preventions/confidence에 반영한다.
51
- * 파일이 없으면 no-op. loadRules 캐시미스 시 1회 호출.
52
- */
53
- export declare function consumeRuleApplications(): void;
@@ -1,22 +0,0 @@
1
- /**
2
- * Rule Promoter — raw data를 스캔하여 승격 조건 충족 시 규칙으로 승격.
3
- *
4
- * 세션 종료 시 또는 수동으로 호출.
5
- * observation → pattern → rule → constraint 4단계 성숙도.
6
- */
7
- interface PromotionResult {
8
- promoted: number;
9
- repromoted: number;
10
- demoted: number;
11
- details: string[];
12
- }
13
- export declare function promoteRules(): PromotionResult;
14
- /**
15
- * 간격 가드 승격 — 지식 소비 지점(calculate_file_risk/trace_blast_radius/get_active_rules)에서
16
- * 자동 호출된다. promoteRules()의 유일한 트리거가 LLM 자발 호출(promote_rules tool)에
17
- * 묶여 rules.jsonl이 채워질 계기가 없던 단절을 잇는다 (mineLedgerCoChanges와 동일 패턴).
18
- */
19
- export declare function promoteRulesIfStale(force?: boolean): PromotionResult & {
20
- skipped?: string;
21
- };
22
- export {};