@winspan/claude-forge 8.53.2 → 8.54.4

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 (394) hide show
  1. package/DEVELOPMENT.md +290 -221
  2. package/README.md +50 -8
  3. package/dist/cli/commands/skills.d.ts.map +1 -1
  4. package/dist/cli/commands/skills.js +7 -3
  5. package/dist/cli/commands/skills.js.map +1 -1
  6. package/dist/cli/init/hook-manager.d.ts +1 -1
  7. package/dist/cli/init/hook-manager.d.ts.map +1 -1
  8. package/dist/cli/init/hook-manager.js +1 -0
  9. package/dist/cli/init/hook-manager.js.map +1 -1
  10. package/dist/core/storage/events.d.ts.map +1 -1
  11. package/dist/core/storage/events.js +0 -1
  12. package/dist/core/storage/events.js.map +1 -1
  13. package/dist/core/storage/maintenance.d.ts +25 -3
  14. package/dist/core/storage/maintenance.d.ts.map +1 -1
  15. package/dist/core/storage/maintenance.js +33 -4
  16. package/dist/core/storage/maintenance.js.map +1 -1
  17. package/dist/core/storage/routing.d.ts +4 -0
  18. package/dist/core/storage/routing.d.ts.map +1 -1
  19. package/dist/core/storage/routing.js +10 -4
  20. package/dist/core/storage/routing.js.map +1 -1
  21. package/dist/core/storage/sessions.d.ts +17 -0
  22. package/dist/core/storage/sessions.d.ts.map +1 -1
  23. package/dist/core/storage/sessions.js +64 -0
  24. package/dist/core/storage/sessions.js.map +1 -1
  25. package/dist/core/storage/skills.d.ts +4 -0
  26. package/dist/core/storage/skills.d.ts.map +1 -1
  27. package/dist/core/storage/skills.js +10 -2
  28. package/dist/core/storage/skills.js.map +1 -1
  29. package/dist/core/storage/sqlite.d.ts +5 -0
  30. package/dist/core/storage/sqlite.d.ts.map +1 -1
  31. package/dist/core/storage/sqlite.js +6 -0
  32. package/dist/core/storage/sqlite.js.map +1 -1
  33. package/dist/core/storage/tasks.d.ts.map +1 -1
  34. package/dist/core/storage/tasks.js +2 -0
  35. package/dist/core/storage/tasks.js.map +1 -1
  36. package/dist/core/types.d.ts +7 -0
  37. package/dist/core/types.d.ts.map +1 -1
  38. package/dist/daemon/index.d.ts.map +1 -1
  39. package/dist/daemon/index.js +19 -4
  40. package/dist/daemon/index.js.map +1 -1
  41. package/dist/skills/official/official-openspec.md +89 -0
  42. package/dist/skills/official-skills.d.ts.map +1 -1
  43. package/dist/skills/official-skills.js +1 -0
  44. package/dist/skills/official-skills.js.map +1 -1
  45. package/dist/skills/registry.d.ts.map +1 -1
  46. package/dist/skills/registry.js +13 -2
  47. package/dist/skills/registry.js.map +1 -1
  48. package/dist/skills/semantic-matcher.d.ts +2 -2
  49. package/dist/skills/semantic-matcher.d.ts.map +1 -1
  50. package/dist/skills/semantic-matcher.js +14 -19
  51. package/dist/skills/semantic-matcher.js.map +1 -1
  52. package/dist/skills/upgrade-engine.d.ts +3 -1
  53. package/dist/skills/upgrade-engine.d.ts.map +1 -1
  54. package/dist/skills/upgrade-engine.js +25 -14
  55. package/dist/skills/upgrade-engine.js.map +1 -1
  56. package/dist/web/analytics/weekly-report.d.ts.map +1 -1
  57. package/dist/web/analytics/weekly-report.js +21 -29
  58. package/dist/web/analytics/weekly-report.js.map +1 -1
  59. package/dist/web/routes/patch.d.ts.map +1 -1
  60. package/dist/web/routes/patch.js +32 -2
  61. package/dist/web/routes/patch.js.map +1 -1
  62. package/dist/web/routes/sessions.d.ts.map +1 -1
  63. package/dist/web/routes/sessions.js +9 -7
  64. package/dist/web/routes/sessions.js.map +1 -1
  65. package/dist/web/routes/trace.d.ts.map +1 -1
  66. package/dist/web/routes/trace.js +2 -3
  67. package/dist/web/routes/trace.js.map +1 -1
  68. package/dist/web/server.d.ts.map +1 -1
  69. package/dist/web/server.js +3 -2
  70. package/dist/web/server.js.map +1 -1
  71. package/package.json +12 -2
  72. package/scripts/postinstall.cjs +21 -0
  73. package/.claude/CLAUDE.md +0 -17
  74. package/.eslintrc.js +0 -23
  75. package/.prettierrc +0 -8
  76. package/ARCHITECTURE_ISSUES.md +0 -249
  77. package/CLAUDE.md +0 -265
  78. package/CLAUDE.md.backup +0 -488
  79. package/docs/concurrent-agents.md +0 -129
  80. package/docs/design/architecture-review-20260516.md +0 -232
  81. package/docs/design/fix-skills-data-and-set-leak-spec-20260516-1300.md +0 -219
  82. package/docs/design/h1-storage-aggregation-spec-20260518-1121.md +0 -299
  83. package/docs/design/h2-getdatabase-encapsulation-spec-20260518-1450.md +0 -191
  84. package/docs/design/h3-fallback-removal-spec-20260518-1245.md +0 -76
  85. package/docs/design/h4-index-dedup-spec-20260518-1230.md +0 -109
  86. package/docs/design/h6-services-migration-spec-20260518-1355.md +0 -82
  87. package/docs/design/hook-failure-queue-spec-20260516-1530.md +0 -204
  88. package/docs/design/l1-swarm-protocol-extract-spec-20260518-1605.md +0 -106
  89. package/docs/design/m10-forge-paths-spec-20260518-1320.md +0 -121
  90. package/docs/design/m2-m3-tool-input-spec-20260518-1425.md +0 -131
  91. package/docs/design/m7-routing-event-association-spec-20260518-1545.md +0 -103
  92. package/docs/design/project-path-gitroot-spec-20260518-1715.md +0 -134
  93. package/docs/design/refactor-phase1-spec-20260515-1600.md +0 -543
  94. package/docs/design/refactor-phase2-spec-20260515-1700.md +0 -424
  95. package/docs/design/skill-ai-upgrade-spec-20260518-1930.md +0 -297
  96. package/docs/design/task-active-gc-spec-20260518-1745.md +0 -146
  97. package/docs/design/tasks-list-filter-pagination-spec-20260518-0930.md +0 -208
  98. package/docs/implementation/daemon-skill-sync-changelog-20260518-2000.md +0 -22
  99. package/docs/implementation/fix-skills-data-and-set-leak-changelog-20260516-1300.md +0 -104
  100. package/docs/implementation/h1-storage-aggregation-changelog-20260518-1121.md +0 -82
  101. package/docs/implementation/h2-final-changelog-20260518-1530.md +0 -61
  102. package/docs/implementation/h2-phase1-safety-net-changelog-20260518-1450.md +0 -70
  103. package/docs/implementation/h2-phase2-operations-changelog-20260518-1450.md +0 -120
  104. package/docs/implementation/h2-phase3-callsites-changelog-20260518-1450.md +0 -71
  105. package/docs/implementation/h3-fallback-removal-changelog-20260518-1245.md +0 -71
  106. package/docs/implementation/h4-index-dedup-changelog-20260518-1230.md +0 -60
  107. package/docs/implementation/h6-services-migration-changelog-20260518-1355.md +0 -46
  108. package/docs/implementation/h7-m9-defaults-changelog-20260518-1300.md +0 -46
  109. package/docs/implementation/hook-failure-queue-changelog-20260516-1530.md +0 -196
  110. package/docs/implementation/hotfix-daemon-event-reject-20260516-1430.md +0 -56
  111. package/docs/implementation/l1-swarm-protocol-extract-changelog-20260518-1605.md +0 -45
  112. package/docs/implementation/l3-l4-daemon-perf-changelog-20260518-1410.md +0 -63
  113. package/docs/implementation/l6-l8-final-cleanup-changelog-20260518-1640.md +0 -38
  114. package/docs/implementation/m1-m4-m5-l7-cleanup-changelog-20260518-1310.md +0 -58
  115. package/docs/implementation/m10-forge-paths-changelog-20260518-1320.md +0 -60
  116. package/docs/implementation/m2-m3-tool-input-changelog-20260518-1425.md +0 -43
  117. package/docs/implementation/m6-m8-naming-shutdown-changelog-20260518-1340.md +0 -56
  118. package/docs/implementation/m7-routing-association-changelog-20260518-1545.md +0 -69
  119. package/docs/implementation/project-path-gitroot-changelog-20260518-1715.md +0 -63
  120. package/docs/implementation/refactor-phase1-changelog-20260515-1630.md +0 -354
  121. package/docs/implementation/refactor-phase2-changelog-20260515-1705.md +0 -421
  122. package/docs/implementation/skill-ai-upgrade-changelog-20260518-1930.md +0 -49
  123. package/docs/implementation/task-active-gc-changelog-20260518-1745.md +0 -35
  124. package/docs/implementation/task-title-summary-changelog-20260518-1130.md +0 -39
  125. package/docs/implementation/tasks-detail-back-loses-filters-changelog-20260518-1100.md +0 -22
  126. package/docs/implementation/tasks-list-filter-pagination-changelog-20260518-0930.md +0 -72
  127. package/docs/implementation/tasks-page-white-screen-hotfix-changelog-20260518-1015.md +0 -56
  128. package/docs/reviews/claudemd-template-sync.md +0 -54
  129. package/docs/reviews/task-title-summary.md +0 -92
  130. package/docs/reviews/tasks-detail-back-loses-filters.md +0 -58
  131. package/docs/reviews/tasks-filter-pagination.md +0 -80
  132. package/docs/reviews/tasks-page-white-screen-hotfix.md +0 -126
  133. package/docs/ruflo-learning-strategy.md +0 -322
  134. package/docs/skills-deduplication-analysis.md +0 -83
  135. package/docs/skills-multiformat-support.md +0 -177
  136. package/docs/skills-third-party.md +0 -183
  137. package/docs/testing/tasks-filter-pagination-test-report.md +0 -86
  138. package/forge +0 -321
  139. package/playwright.config.ts +0 -40
  140. package/scripts/demo-v2.ts +0 -91
  141. package/scripts/dev-daemon.sh +0 -232
  142. package/scripts/dev-web.ts +0 -109
  143. package/scripts/e2e-mcp-link.ts +0 -423
  144. package/scripts/e2e-methodology-quality.ts +0 -253
  145. package/scripts/e2e-routing.ts +0 -456
  146. package/scripts/e2e-user-methodology.ts +0 -326
  147. package/scripts/e2e-web-workflows.ts +0 -299
  148. package/scripts/migrate-legacy-to-dynamic.sql +0 -108
  149. package/scripts/regenerate-execution-docs.ts +0 -116
  150. package/scripts/sync-agent-skills.ts +0 -193
  151. package/scripts/test-hook.sh +0 -71
  152. package/scripts/verify-skill-loading.ts +0 -62
  153. package/src/claudemd/claudemd-generator.ts +0 -568
  154. package/src/claudemd/convention-extractor.ts +0 -69
  155. package/src/claudemd/index.ts +0 -35
  156. package/src/claudemd/persona-manager.ts +0 -88
  157. package/src/claudemd/resume-manager.ts +0 -236
  158. package/src/claudemd/tech-detector.ts +0 -220
  159. package/src/claudemd/templates/swarm-protocol.md +0 -222
  160. package/src/cli/commands/claudemd.ts +0 -84
  161. package/src/cli/commands/config.ts +0 -46
  162. package/src/cli/commands/daemon.ts +0 -310
  163. package/src/cli/commands/executions.ts +0 -115
  164. package/src/cli/commands/init.ts +0 -204
  165. package/src/cli/commands/logs.ts +0 -181
  166. package/src/cli/commands/mcp.ts +0 -242
  167. package/src/cli/commands/menu.ts +0 -357
  168. package/src/cli/commands/skills.ts +0 -328
  169. package/src/cli/commands/stats.ts +0 -73
  170. package/src/cli/commands/status.ts +0 -69
  171. package/src/cli/commands/template.ts +0 -77
  172. package/src/cli/commands/trace.ts +0 -148
  173. package/src/cli/index.ts +0 -42
  174. package/src/cli/init/hook-manager.ts +0 -132
  175. package/src/core/ai/provider.ts +0 -308
  176. package/src/core/ai/types.ts +0 -51
  177. package/src/core/config.ts +0 -124
  178. package/src/core/constants.ts +0 -67
  179. package/src/core/event-fields.ts +0 -32
  180. package/src/core/queue/index.ts +0 -192
  181. package/src/core/storage/base.ts +0 -302
  182. package/src/core/storage/events.ts +0 -434
  183. package/src/core/storage/injections.ts +0 -78
  184. package/src/core/storage/maintenance.ts +0 -59
  185. package/src/core/storage/migrations/002_add_skill_tracking.sql +0 -6
  186. package/src/core/storage/migrations/003_add_skill_invocations.sql +0 -23
  187. package/src/core/storage/performance-indexes.sql +0 -23
  188. package/src/core/storage/routing.ts +0 -322
  189. package/src/core/storage/rows.ts +0 -112
  190. package/src/core/storage/schema.sql +0 -224
  191. package/src/core/storage/sessions.ts +0 -168
  192. package/src/core/storage/skills.ts +0 -233
  193. package/src/core/storage/sqlite.ts +0 -293
  194. package/src/core/storage/tasks.ts +0 -318
  195. package/src/core/storage/token-usage.ts +0 -93
  196. package/src/core/types.ts +0 -181
  197. package/src/core/utils/error-handler.ts +0 -257
  198. package/src/core/utils/forge-resume-block.ts +0 -74
  199. package/src/core/utils/format.ts +0 -69
  200. package/src/core/utils/git.ts +0 -23
  201. package/src/core/utils/logger.ts +0 -134
  202. package/src/core/utils/lru-cache.ts +0 -54
  203. package/src/core/utils/path.ts +0 -19
  204. package/src/core/utils/session.ts +0 -26
  205. package/src/core/utils/time.ts +0 -37
  206. package/src/core/utils/token-tracker.ts +0 -97
  207. package/src/daemon/event-parser.ts +0 -36
  208. package/src/daemon/handlers/history-exporter.ts +0 -117
  209. package/src/daemon/handlers/post-tool-use.ts +0 -54
  210. package/src/daemon/handlers/stop.ts +0 -208
  211. package/src/daemon/handlers/user-prompt.ts +0 -178
  212. package/src/daemon/hook-sync.ts +0 -91
  213. package/src/daemon/index.ts +0 -312
  214. package/src/daemon/launchd/com.claude-forge.daemon.plist.template +0 -47
  215. package/src/daemon/launchd-installer.ts +0 -260
  216. package/src/daemon/lifecycle.ts +0 -128
  217. package/src/daemon/router.ts +0 -40
  218. package/src/daemon/server.ts +0 -196
  219. package/src/daemon/services/task-segmenter.ts +0 -112
  220. package/src/daemon/skill-sync.ts +0 -88
  221. package/src/hooks/hook-lib.sh +0 -118
  222. package/src/hooks/notification.sh +0 -35
  223. package/src/hooks/post-tool-use.sh +0 -61
  224. package/src/hooks/pre-tool-use.sh +0 -63
  225. package/src/hooks/stop.sh +0 -43
  226. package/src/hooks/user-prompt-submit.sh +0 -69
  227. package/src/mcp/server.ts +0 -322
  228. package/src/skills/index.ts +0 -2
  229. package/src/skills/invocation-guard.ts +0 -177
  230. package/src/skills/matcher.ts +0 -148
  231. package/src/skills/official/code-simplifier.md +0 -52
  232. package/src/skills/official/find-skills.md +0 -142
  233. package/src/skills/official/official-api-design.md +0 -30
  234. package/src/skills/official/official-architecture-decision.md +0 -41
  235. package/src/skills/official/official-bmad.md +0 -118
  236. package/src/skills/official/official-db-schema-design.md +0 -34
  237. package/src/skills/official/official-debug.md +0 -25
  238. package/src/skills/official/official-doc-driven.md +0 -31
  239. package/src/skills/official/official-harness-engineering.md +0 -108
  240. package/src/skills/official/official-performance-optimization.md +0 -30
  241. package/src/skills/official/official-pr-review.md +0 -35
  242. package/src/skills/official/official-release-checklist.md +0 -30
  243. package/src/skills/official/official-security-hardening.md +0 -32
  244. package/src/skills/official/official-spec-driven-design.md +0 -31
  245. package/src/skills/official/planning-with-files.md +0 -241
  246. package/src/skills/official/ui-ux-pro-max.md +0 -105
  247. package/src/skills/official/webapp-testing.md +0 -96
  248. package/src/skills/official-skills.ts +0 -89
  249. package/src/skills/registry.ts +0 -355
  250. package/src/skills/semantic-matcher.ts +0 -234
  251. package/src/skills/tools/pipeline-suggest.ts +0 -226
  252. package/src/skills/tools/skill-invoke.ts +0 -168
  253. package/src/skills/tools/skill-list.ts +0 -59
  254. package/src/skills/upgrade-engine.ts +0 -541
  255. package/src/skills/upgrade-prompt.ts +0 -84
  256. package/src/templates/go.yaml +0 -53
  257. package/src/templates/python.yaml +0 -59
  258. package/src/templates/react.yaml +0 -55
  259. package/src/templates/template-manager.ts +0 -170
  260. package/src/web/analytics/anti-pattern-detector.ts +0 -367
  261. package/src/web/analytics/drift-detector.ts +0 -219
  262. package/src/web/analytics/weekly-report.ts +0 -431
  263. package/src/web/auth-middleware.ts +0 -54
  264. package/src/web/routes/_helpers.ts +0 -34
  265. package/src/web/routes/ai.ts +0 -204
  266. package/src/web/routes/auth.ts +0 -22
  267. package/src/web/routes/drift.ts +0 -25
  268. package/src/web/routes/error-handler.ts +0 -120
  269. package/src/web/routes/events.ts +0 -47
  270. package/src/web/routes/insights.ts +0 -43
  271. package/src/web/routes/patch.ts +0 -117
  272. package/src/web/routes/reports.ts +0 -34
  273. package/src/web/routes/rules.ts +0 -76
  274. package/src/web/routes/sessions.ts +0 -250
  275. package/src/web/routes/skill-stats.ts +0 -92
  276. package/src/web/routes/skills.ts +0 -350
  277. package/src/web/routes/static.ts +0 -67
  278. package/src/web/routes/stats.ts +0 -50
  279. package/src/web/routes/status.ts +0 -30
  280. package/src/web/routes/tasks.ts +0 -193
  281. package/src/web/routes/token-usage.ts +0 -20
  282. package/src/web/routes/trace.ts +0 -126
  283. package/src/web/routes/types.ts +0 -57
  284. package/src/web/server.ts +0 -134
  285. package/src/web/ssrf-guard.ts +0 -112
  286. package/src/web/static/index.html +0 -3251
  287. package/src/web/static/vendor/chart.umd.min.js +0 -20
  288. package/tests/e2e/dashboard.spec.ts +0 -205
  289. package/tests/e2e/routing-skill-e2e.test.ts +0 -39
  290. package/tests/helpers/mock-ai.ts +0 -92
  291. package/tests/helpers/mock-storage.ts +0 -159
  292. package/tests/integration/claudemd-generator.test.ts +0 -90
  293. package/tests/integration/queue-replay.integration.test.ts +0 -193
  294. package/tests/integration/tasks-filter.integration.test.ts +0 -154
  295. package/tests/integration/web-analytics.integration.test.ts +0 -133
  296. package/tests/integration/web-stats.integration.test.ts +0 -135
  297. package/tests/integration/web-trace.integration.test.ts +0 -175
  298. package/tests/performance/database.benchmark.ts +0 -161
  299. package/tests/semantic-matcher.test.ts +0 -99
  300. package/tests/skill-matcher.test.ts +0 -110
  301. package/tests/unit/ai-provider-retry.test.ts +0 -194
  302. package/tests/unit/ai-provider-vision.test.ts +0 -224
  303. package/tests/unit/claudemd-generator.test.ts +0 -68
  304. package/tests/unit/cli-mcp.test.ts +0 -141
  305. package/tests/unit/core/forge-paths.test.ts +0 -99
  306. package/tests/unit/daemon/hook-sync.test.ts +0 -71
  307. package/tests/unit/daemon/post-tool-use.test.ts +0 -121
  308. package/tests/unit/daemon/skill-sync.test.ts +0 -75
  309. package/tests/unit/daemon/stop-handler-behavior-summary.test.ts +0 -202
  310. package/tests/unit/daemon/task-segmenter-recover.test.ts +0 -84
  311. package/tests/unit/event-fields.test.ts +0 -88
  312. package/tests/unit/event-parser.test.ts +0 -55
  313. package/tests/unit/handlers.test.ts +0 -171
  314. package/tests/unit/hooks/resolve-project-path.test.ts +0 -122
  315. package/tests/unit/invocation-guard.test.ts +0 -125
  316. package/tests/unit/queue.test.ts +0 -272
  317. package/tests/unit/router.test.ts +0 -138
  318. package/tests/unit/security.test.ts +0 -128
  319. package/tests/unit/skill-invocations-workflow.test.ts +0 -495
  320. package/tests/unit/skill-registry.test.ts +0 -94
  321. package/tests/unit/skills/invocation-guard-ttl.test.ts +0 -211
  322. package/tests/unit/skills/official-skills-loader.test.ts +0 -126
  323. package/tests/unit/skills/registry-multiformat.test.ts +0 -92
  324. package/tests/unit/skills/upgrade-engine-parse.test.ts +0 -138
  325. package/tests/unit/skills/upgrade-engine.test.ts +0 -401
  326. package/tests/unit/skills/upgrade-prompt.test.ts +0 -89
  327. package/tests/unit/socket-server.test.ts +0 -183
  328. package/tests/unit/storage/event-operations-aggregates.test.ts +0 -342
  329. package/tests/unit/storage/migration-idempotent.test.ts +0 -304
  330. package/tests/unit/storage/routing-aggregates.test.ts +0 -276
  331. package/tests/unit/storage/routing.test.ts +0 -117
  332. package/tests/unit/storage/schema-missing.test.ts +0 -81
  333. package/tests/unit/storage/session-operations-aggregates.test.ts +0 -120
  334. package/tests/unit/storage/sessions-aggregate.test.ts +0 -435
  335. package/tests/unit/storage/skill-operations-counts.test.ts +0 -106
  336. package/tests/unit/storage/skills-aggregates.test.ts +0 -104
  337. package/tests/unit/storage/sqlite-refactor-harness.test.ts +0 -314
  338. package/tests/unit/storage/task-operations-counts.test.ts +0 -46
  339. package/tests/unit/storage/tasks-getById.test.ts +0 -343
  340. package/tests/unit/storage/tasks-stale-gc.test.ts +0 -86
  341. package/tests/unit/storage.test.ts +0 -172
  342. package/tests/unit/token-usage.test.ts +0 -144
  343. package/tests/unit/type-guards.test.ts +0 -201
  344. package/tests/unit/utils/format.test.ts +0 -189
  345. package/tests/unit/utils/session.test.ts +0 -89
  346. package/tests/unit/utils/time.test.ts +0 -112
  347. package/tests/unit/web/navigation-back-contract.test.ts +0 -134
  348. package/tests/unit/web/routes-auth.test.ts +0 -93
  349. package/tests/unit/web/routes-events.test.ts +0 -101
  350. package/tests/unit/web/routes-rules.test.ts +0 -182
  351. package/tests/unit/web/routes-sessions.test.ts +0 -181
  352. package/tests/unit/web/routes-skill-stats.test.ts +0 -179
  353. package/tests/unit/web/routes-stats.test.ts +0 -92
  354. package/tests/unit/web/routes-tasks.test.ts +0 -385
  355. package/tests/unit/web/task-title-contract.test.ts +0 -210
  356. package/tests/unit/web/tasks-component-contract.test.ts +0 -179
  357. package/tsconfig.json +0 -22
  358. package/vitest.config.ts +0 -21
  359. package/vitest.integration.config.ts +0 -16
  360. package/web/CLAUDE.md +0 -20
  361. package/web/index.html +0 -13
  362. package/web/package-lock.json +0 -4854
  363. package/web/package.json +0 -35
  364. package/web/postcss.config.js +0 -6
  365. package/web/src/App.tsx +0 -110
  366. package/web/src/components/CodeBlock.tsx +0 -31
  367. package/web/src/components/Confirm.tsx +0 -96
  368. package/web/src/components/Drawer.tsx +0 -60
  369. package/web/src/components/Layout.tsx +0 -145
  370. package/web/src/components/MarkdownRenderer.tsx +0 -77
  371. package/web/src/components/SearchInput.tsx +0 -31
  372. package/web/src/components/SessionDetailContent.tsx +0 -157
  373. package/web/src/components/Toast.tsx +0 -92
  374. package/web/src/index.css +0 -19
  375. package/web/src/main.tsx +0 -31
  376. package/web/src/pages/AIConfig.tsx +0 -233
  377. package/web/src/pages/Dashboard.tsx +0 -572
  378. package/web/src/pages/Events.tsx +0 -271
  379. package/web/src/pages/Reports.tsx +0 -428
  380. package/web/src/pages/SessionDetail.tsx +0 -162
  381. package/web/src/pages/Sessions.tsx +0 -205
  382. package/web/src/pages/Skills.tsx +0 -180
  383. package/web/src/pages/TaskDetail.tsx +0 -515
  384. package/web/src/pages/Tasks.tsx +0 -415
  385. package/web/src/utils/auth.ts +0 -59
  386. package/web/src/utils/export.ts +0 -54
  387. package/web/src/utils/navigation.ts +0 -25
  388. package/web/src/utils/task-title.ts +0 -49
  389. package/web/src/utils/time.ts +0 -13
  390. package/web/tailwind.config.js +0 -11
  391. package/web/tsconfig.json +0 -21
  392. package/web/tsconfig.node.json +0 -10
  393. package/web/vite.config.ts +0 -76
  394. package/winspan-claude-forge-8.43.0.tgz +0 -0
@@ -1,56 +0,0 @@
1
- # Changelog: Tasks Page White Screen Hotfix
2
-
3
- **Date**: 2026-05-18 10:15
4
- **Bug slug**: tasks-page-white-screen
5
- **Workflow**: harness-hotfix (safety-net → fix → verify)
6
-
7
- ## Phase 1: safety-net
8
-
9
- Created `tests/unit/web/tasks-component-contract.test.ts` with 15 characterization tests:
10
- - Documents the broken consumer behaviour (TypeError on `.filter` of `TaskPage` object)
11
- - Locks the correct `{ items, total, has_more }` API contract
12
- - Tests pagination parameter logic
13
-
14
- All 15 tests pass immediately (they lock current correct contract + document the defect pattern).
15
-
16
- ## Phase 2: fix
17
-
18
- ### Files Modified
19
-
20
- **`web/src/pages/Tasks.tsx`** — full rewrite
21
- - Fixed `fetchTasks` return type from `Task[]` to `TaskPage`
22
- - Destructure `data.items`, `data.total`, `data.has_more` correctly
23
- - Added URL sync via `useSearchParams` (page, size, project, preset, from, to, search)
24
- - Added project multi-select dropdown (fetches `/api/tasks/projects`)
25
- - Added time presets (1h / 24h / 7d)
26
- - Added pagination controls (prev/next + page size selector 20/50/100)
27
- - Added "共 N 条" total count display
28
- - Added `shortPath()` helper to truncate project paths to last 2 segments
29
- - Tailwind utility classes only, no inline styles
30
-
31
- **`CLAUDE.md`** (line 184)
32
- - Changed: `原生 HTML + Vanilla JS(单文件 SPA),无打包`
33
- - To: `React 18 + Vite + Tailwind + react-router-dom + react-query + Recharts(\`web/\` 目录,build 后被 cp 到 dist/web/static/)`
34
-
35
- **`src/claudemd/claudemd-generator.ts`** (line 737)
36
- - Same correction in embedded template, backtick escaped to `\`` to avoid breaking the template literal
37
-
38
- ### No Backend Changes
39
-
40
- `App.tsx` already had correct `<Route path="tasks">` config.
41
- `Layout.tsx` already had Tasks nav item with `ListTodo` icon.
42
- All backend routes (`/api/tasks`, `/api/tasks/projects`) were correct and untouched.
43
-
44
- ## Phase 3: verify
45
-
46
- - `web/` TypeScript: clean
47
- - Root TypeScript: clean (after escaping backtick in template literal)
48
- - `web/npm run build`: success, `Tasks-D98y3WV2.js` chunk produced
49
- - Root `npm run build`: success, chunk copied to `dist/web/static/assets/`
50
- - Test results: 338/339 pass (1 pre-existing failure in sqlite-refactor-harness, unrelated)
51
- - `curl http://127.0.0.1:3721/` → 200 OK, HTML contains 8 vite/module references
52
- - API response confirmed: `{"items":[...],"total":393,"has_more":true}`
53
-
54
- ## Action Required
55
-
56
- Run `./scripts/dev-daemon.sh restart` to serve the updated bundle.
@@ -1,54 +0,0 @@
1
- # Fix Report: claudemd-template-sync
2
-
3
- ## Root Cause
4
-
5
- Template drift between `CLAUDE.md` (source of truth) and the `SWARM_PROTOCOL` constant embedded in `src/claudemd/claudemd-generator.ts`.
6
-
7
- Commit `34bb288` (v8.50.4) added the "工作流升级判定" section plus related updates to `CLAUDE.md`, but the generator's hardcoded template was never updated. As a result, `claude-forge claudemd init` on new projects would inject the stale template missing:
8
-
9
- 1. Self-check item #4 (testing coverage < 50% trigger)
10
- 2. Updated violation examples (daemon hotfix / Skills data separation / Hook queue)
11
- 3. New Two-Phase Workflow title `(BMAD 默认路径)` with prerequisite note
12
- 4. Entire "工作流升级判定" section: decision table, coverage quick-check command, module coverage status table, and past-violation reminder
13
-
14
- ## Fix Points
15
-
16
- **File**: `src/claudemd/claudemd-generator.ts`
17
- **Lines changed**: 555–738 (the `SWARM_PROTOCOL` template string constant)
18
-
19
- Key changes applied:
20
- - Self-check expanded from 3 items to 4 (added "测试覆盖率 < 50%" trigger condition)
21
- - Violation examples updated to `harness-hotfix` / `refactor-safe` / `hybrid-feature-with-safety` pattern
22
- - Two-Phase Workflow title changed from `(Design-First)` to `(BMAD 默认路径)` + added prerequisite line
23
- - Inserted full "工作流升级判定" section between Agent 委托规则 and 并发规则
24
- - Removed stale hard-coded forge:resume block from template (resume blocks are daemon-managed at runtime, not part of the static template)
25
-
26
- ## New Tests Added
27
-
28
- **File**: `tests/unit/claudemd-generator.test.ts`
29
- **Test count**: 8 characterization tests
30
-
31
- | Test | Assertion |
32
- |------|-----------|
33
- | 1 | Output contains `## 核心行为规则` |
34
- | 2 | Output contains `Two-Phase Workflow (BMAD 默认路径)` (new title) |
35
- | 3 | Output contains `工作流升级判定` |
36
- | 4 | Output contains `harness-hotfix` |
37
- | 5 | Output contains `refactor-safe` |
38
- | 6 | Output contains `测试覆盖率 < 50%` |
39
- | 7 | Output contains `## Agent 委托规则` |
40
- | 8 | Output does NOT contain `Two-Phase Workflow (Design-First)` (old title gone) |
41
-
42
- Safety-net red run: 6/8 tests failed against old template (correctly detected the bug).
43
- Fix green run: 8/8 tests pass.
44
-
45
- ## Regression Test Results
46
-
47
- Full suite before fix: **3 test files failed, 9 tests failed**
48
- Full suite after fix: **2 test files failed, 3 tests failed**
49
-
50
- The 3 remaining failures (`routes-tasks.test.ts` ×2, `sqlite-refactor-harness.test.ts` ×1) are pre-existing failures caused by UUID validation on `event_id` — unrelated to this fix.
51
-
52
- TypeScript type check (`npx tsc --noEmit`): clean, no errors.
53
-
54
- Dist verification: `grep -c "工作流升级判定" dist/claudemd/claudemd-generator.js` → **3 matches** (section title, table header, column value).
@@ -1,92 +0,0 @@
1
- # Fix Report: task-title-summary
2
-
3
- **Bug slug**: `task-title-summary`
4
- **Date**: 2026-05-18
5
- **Workflow**: harness-hotfix (safety-net → fix → verify)
6
-
7
- ---
8
-
9
- ## Root Cause
10
-
11
- Sub-agent completion callbacks are pushed to the session as a `UserPromptSubmit`
12
- event whose content is the raw `<task-notification>` XML blob. The
13
- `task-segmenter` uses the first user-prompt content as the task `title`, so
14
- tasks spawned from these callbacks end up with a title like:
15
-
16
- ```
17
- <task-notification>
18
- <task-id>aefe161c…</task-id>
19
-
20
- <summary>Agent "Hotfix Tasks 返回丢筛选" completed</summary>
21
-
22
- </task-notification>
23
- ```
24
-
25
- The frontend rendered the literal XML string in both the Tasks list (`h3`) and
26
- the TaskDetail header (`h1`), making the task unrecognisable.
27
-
28
- **Backend was intentionally left unchanged** — the raw XML is the ground truth.
29
- The fix lives entirely in the frontend presentation layer.
30
-
31
- ---
32
-
33
- ## Fix Points
34
-
35
- | File | Change |
36
- |------|--------|
37
- | `web/src/utils/task-title.ts` | **New file** — pure helper `normalizeTaskTitle()` |
38
- | `web/src/pages/Tasks.tsx` | Import + wrap `{task.title}` → `{normalizeTaskTitle(task.title)}` in list `<h3>` |
39
- | `web/src/pages/TaskDetail.tsx` | Import + wrap `{data.title}` → `{normalizeTaskTitle(data.title)}` in detail `<h1>` |
40
-
41
- ### `normalizeTaskTitle` logic (MAX_LEN = 80)
42
-
43
- 1. `null / undefined / whitespace` → `"(无标题)"`
44
- 2. Title starts with `<task-notification>`:
45
- - Has `<summary>` with non-blank content → extract, trim, truncate + `…` if > 80 chars
46
- - No `<summary>` or blank → `"(子任务回调)"`
47
- 3. Regular title → trim, truncate + `…` if > 80 chars
48
-
49
- ---
50
-
51
- ## New Tests
52
-
53
- File: `tests/unit/web/task-title-contract.test.ts`
54
-
55
- **19 test cases** covering:
56
-
57
- | Group | Cases |
58
- |-------|-------|
59
- | Passthrough | normal title, English title, whitespace trim |
60
- | Fallback | empty string, whitespace-only, null, undefined |
61
- | XML extraction | full blob, missing summary, bare tag, emoji+Chinese, quotes, first-match-wins |
62
- | Truncation | summary > 80, summary = 80, plain title > 80, plain title = 80 |
63
- | Summary whitespace | padded summary, whitespace-only summary |
64
-
65
- ---
66
-
67
- ## Regression / Build Verification
68
-
69
- ```
70
- Tests: 19 passed (task-title-contract.test.ts — all green)
71
- Suite: 378 passed, 1 pre-existing failure (sqlite-refactor-harness / uuid validation,
72
- unrelated to this change, present before this fix)
73
-
74
- web build: ✓ built in 2.50s (no errors)
75
- new chunk: dist/assets/task-title-Bc8tnLXB.js (0.36 kB gzip: 0.30 kB)
76
- Tasks chunk hash: Tasks-C8JHCGTC.js
77
- TaskDetail chunk hash: TaskDetail-DYEk8pNw.js
78
-
79
- TypeScript: npx tsc --noEmit → 0 errors (root)
80
- npx tsc --noEmit → 0 errors (web/)
81
- ```
82
-
83
- ---
84
-
85
- ## Notes
86
-
87
- - `normalizeTaskTitle` is a pure function with zero React dependency — safe to
88
- test in Node environment without jsdom.
89
- - The helper intentionally **does not** modify stored data. Backend titles remain
90
- unchanged; this is purely a display-layer normalisation.
91
- - The first `<summary>` match is used defensively in case of malformed XML with
92
- duplicate tags.
@@ -1,58 +0,0 @@
1
- # Fix Report: tasks-detail-back-loses-filters
2
-
3
- **Date**: 2026-05-18
4
- **Workflow**: harness-hotfix (safety-net → fix → verify)
5
-
6
- ---
7
-
8
- ## Root Cause
9
-
10
- `TaskDetail.tsx` used `<Link to="/tasks">` — a hard absolute path — for both the
11
- error-state and success-state "back" buttons (lines 161 and 195 of the original
12
- file). React Router resolves this to `/tasks` with no query string, discarding
13
- whatever filter state the user had on the Tasks page.
14
-
15
- Concretely: a user at `/tasks?project=foo&page=2` clicks a task, lands on
16
- `/tasks/<id>`, then clicks "返回" → router navigates to `/tasks` (no `?project=foo&page=2`).
17
- `useSearchParams()` returns empty values, so the Tasks page re-renders showing
18
- all tasks from page 1.
19
-
20
- ---
21
-
22
- ## Fix Points
23
-
24
- | File | Change |
25
- |------|--------|
26
- | `web/src/utils/navigation.ts` (new) | Pure function `resolveBackTo(state, fallback='/tasks'): string` with full type narrowing — no `as any`. |
27
- | `web/src/pages/Tasks.tsx` | Added `useLocation` import. Added `const location = useLocation()` in component body. Changed `navigate(\`/tasks/${task.id}\`)` to `navigate(\`/tasks/${task.id}\`, { state: { from: location.pathname + location.search } })`. |
28
- | `web/src/pages/TaskDetail.tsx` | Added `useLocation` + `resolveBackTo` imports. Added `const location = useLocation()` and `const backTo = resolveBackTo(location.state)` in component body. Replaced both `<Link to="/tasks">` with `<Link to={backTo}>` (error branch line ~161, success branch line ~195). |
29
-
30
- ---
31
-
32
- ## New Tests
33
-
34
- **File**: `tests/unit/web/navigation-back-contract.test.ts`
35
-
36
- 21 contract tests across 4 suites:
37
-
38
- 1. **fallback path** (7 tests) — `state` is `null`, `undefined`, `{}`, `{ from: undefined }`, `{ from: '' }`, custom fallback with `null`, custom fallback with `{}`.
39
- 2. **happy path** (5 tests) — `state.from` carries full query string with project filter, page number, preset, search; plain `/tasks` (no query string).
40
- 3. **type safety** (6 tests) — `state.from` is number, array, object, `null`; `state` itself is a number or string — all fall back gracefully.
41
- 4. **navigation state construction** (3 tests) — verifies the `location.pathname + location.search` encoding round-trips without mutation; handles empty search string.
42
-
43
- Tests import from the real `web/src/utils/navigation.ts` module.
44
-
45
- ---
46
-
47
- ## Regression Test Results
48
-
49
- | Run | Files | Tests | Failures |
50
- |-----|-------|-------|---------|
51
- | Pre-change baseline | 1 failed / 29 passed | 1 failed / 359 passed | `sqlite-refactor-harness.test.ts` (pre-existing, unrelated) |
52
- | Post-fix | 1 failed / 29 passed | 1 failed / 359 passed | same pre-existing failure only |
53
-
54
- - `npm run build` (web/): clean — 0 TypeScript errors, 0 Vite errors
55
- - `npx tsc --noEmit` (project root): 0 errors
56
- - `npx tsc --noEmit` (web/): 0 errors (run as part of `npm run build`)
57
- - New safety-net: 21/21 pass
58
- - Existing tasks contract: 15/15 pass (no regression)
@@ -1,80 +0,0 @@
1
- # Code Review — tasks-filter-pagination
2
-
3
- **Date**: 2026-05-18
4
- **Reviewer**: self (automated review)
5
- **Spec**: docs/design/tasks-list-filter-pagination-spec-20260518-0930.md
6
-
7
- ---
8
-
9
- ## Acceptance Criteria Checklist (A1-A8)
10
-
11
- | # | Scenario | Implementation | Status |
12
- |---|----------|---------------|--------|
13
- | A1 | `GET /api/tasks?limit=10&offset=0` returns `{ items, total, has_more }` | `queryTasksFiltered` returns `TaskPage`, route returns JSON | DONE |
14
- | A2 | `?project=/path/foo` returns only that project's tasks | `WHERE s.project_path IN (?)` via JOIN | DONE |
15
- | A3 | `?project=a&project=b` OR relationship | `IN (?, ?)` clause with array | DONE |
16
- | A4 | `?from=...&to=...` start_time range filter | `t.start_time >= ?` / `<= ?` | DONE |
17
- | A5 | `?search=重构` title LIKE | `t.title LIKE ?` with `%...%` wrapping | DONE |
18
- | A6 | `?limit=201` clamps to 200 | Zod `.transform(v => Math.min(v, 200))` | DONE |
19
- | A7 | URL sync `?range=24h&search=build&page=1` survives refresh | `tasksStateToURL()` + `tasksURLToState()` in initTasksPage | DONE (manual E2E needed) |
20
- | A8 | Next page: offset increments, total constant | pagination buttons + offset calc | DONE |
21
-
22
- ---
23
-
24
- ## Index Usage Evidence (EXPLAIN QUERY PLAN)
25
-
26
- ### Without project filter (full table → ORDER BY)
27
- ```
28
- SCAN t USING INDEX idx_tasks_start_time_session ← composite index used
29
- SEARCH s USING INDEX sqlite_autoindex_sessions_1 (session_id=?)
30
- ```
31
- Composite index `idx_tasks_start_time_session ON tasks(start_time DESC, session_id)` avoids sorting for the common no-filter case.
32
-
33
- ### With project filter
34
- ```
35
- SEARCH s USING INDEX idx_sessions_project (project_path=?)
36
- SEARCH t USING INDEX idx_tasks_session (session_id=?)
37
- USE TEMP B-TREE FOR ORDER BY
38
- ```
39
- B-TREE sort occurs because the drive table is sessions (filtered by project). Acceptable for <10k rows.
40
-
41
- ---
42
-
43
- ## Changed Files
44
-
45
- | File | Nature of change |
46
- |------|-----------------|
47
- | `src/core/storage/schema.sql` | Added `idx_tasks_start_time_session` composite index |
48
- | `src/core/storage/tasks.ts` | Added `queryTasksFiltered`, `queryTaskProjects`, `TaskFilter`, `TaskPage` types, `buildWhereConditions`, `mapRow` private helpers |
49
- | `src/core/storage/sqlite.ts` | Exposed `queryTasksFiltered`, `queryTaskProjects`; re-exported `TaskFilter`, `TaskPage` |
50
- | `src/web/routes/tasks.ts` | Full rewrite: Zod `TaskListQuery`, `/projects` sub-route, paginated list route, detail route unchanged |
51
- | `src/web/static/index.html` | Tasks sidebar nav item + `#page-tasks` HTML + `loadTasks` / `initTasksPage` / URL sync / debounce / drawer detail |
52
- | `tests/unit/web/routes-tasks.test.ts` | Fixed non-UUID event_ids; updated [CHAR] tests to new schema; added 14 new test cases |
53
- | `tests/integration/tasks-filter.integration.test.ts` | New: 10 integration tests against real SQLite |
54
- | `CLAUDE.md` | Fixed `前端: React + Vite + Recharts` → `原生 HTML + Vanilla JS(单文件 SPA),无打包` |
55
- | `src/claudemd/claudemd-generator.ts` | Same correction in SWARM_PROTOCOL template |
56
-
57
- ---
58
-
59
- ## Breaking Change
60
-
61
- `GET /api/tasks` now returns `{ items, total, has_more }` instead of bare `Task[]`. Dashboard code (`loadDashboard`) doesn't call `/api/tasks` (only `/api/sessions`). No other callers found by grep. Scope: internal dashboard only.
62
-
63
- ---
64
-
65
- ## Known Limitations / TODO
66
-
67
- 1. **Frontend E2E (A7)** — URL state sync for range/search/page not covered by automated tests. Manual verification required against running daemon.
68
- 2. **Title LIKE is case-insensitive for ASCII only** — CJK characters behave correctly in SQLite UTF-8, but no explicit test for mixed-case ASCII vs. UTF-8 mixes.
69
- 3. **`/api/tasks/:taskId` still uses `queryTasks({limit:5000})`** — linear scan to find task by ID. Pre-existing issue, out of scope for this feature.
70
- 4. **ISO 8601 string sort** — `from`/`to` params must use same precision (`.000Z`) as stored timestamps for exact boundary matching. Documented in test comments.
71
- 5. **B-TREE sort overhead** — when filtering by project, SQLite uses a temp B-TREE for ORDER BY. Acceptable for <10k rows but would benefit from a covering index if the dataset grows.
72
-
73
- ---
74
-
75
- ## Quality Assessment
76
-
77
- - BLOCKER issues: none
78
- - MAJOR issues: none
79
- - MINOR: `/api/tasks/:taskId` detail route still uses `queryTasks({limit:5000})` for task lookup — not introduced by this PR, pre-existing
80
- - NIT: `any` type in `userPrompts` map (`.tool_input as any`) — pre-existing, not introduced here
@@ -1,126 +0,0 @@
1
- # Hotfix Report: Tasks Page White Screen
2
-
3
- **Bug slug**: tasks-page-white-screen
4
- **Date**: 2026-05-18
5
- **Severity**: P0 (production white screen on Tasks nav item click)
6
-
7
- ---
8
-
9
- ## Root Cause
10
-
11
- ### Error Chain
12
-
13
- 1. `web/src/App.tsx:12` lazy-imports `./pages/Tasks`
14
- 2. `Tasks.tsx` (pre-fix) called `GET /api/tasks` and did `return res.json()` — treating the response body as `Task[]`
15
- 3. `GET /api/tasks` actually returns `{ items: Task[], total: number, has_more: boolean }` — a paginated wrapper (`TaskPage`), not a bare array
16
- 4. The component called `tasks.filter(...)` on the `TaskPage` object, which has no `.filter` method → `TypeError: tasks.filter is not a function`
17
- 5. React's error boundary was not configured → unhandled `TypeError` inside `<Suspense>` → white screen
18
-
19
- ### Why This Shape Mismatch Existed
20
-
21
- The backend `/api/tasks` route was upgraded (v8.50.6 implementation task `tasks-filter-pagination`) to add filter + pagination support, returning `{ items, total, has_more }`. The `Tasks.tsx` component was a pre-existing stub that was never updated to consume the new paginated shape.
22
-
23
- ### Why v8.50.6 Spec Walked Off Target
24
-
25
- The planner agent generating the v8.50.6 spec analyzed `src/web/routes/tasks.ts` (backend) but did not inspect `web/src/pages/Tasks.tsx` (frontend). It documented the backend correctly but left the frontend in an inconsistent state. Additionally, `CLAUDE.md` was incorrectly updated to say the frontend uses "原生 HTML + Vanilla JS" (Vanilla JS) rather than React + Vite — this misdirected future agents away from looking in `web/`.
26
-
27
- **How to avoid next time**:
28
- - When modifying a backend API shape, always grep for frontend consumers in `web/src/` before closing the task
29
- - `CLAUDE.md` tech stack description is a critical navigation signal for agents — any incorrect entry should be treated as a P1 issue
30
- - Add a CI check or spec gate: "if API response shape changes, verify frontend page component is updated"
31
-
32
- ---
33
-
34
- ## Fix Points
35
-
36
- ### Modified Files
37
-
38
- | File | Lines | Change |
39
- |------|-------|--------|
40
- | `web/src/pages/Tasks.tsx` | full rewrite (~290 lines) | Fix `fetchTasks` to return `TaskPage`, destructure `items`/`total`/`has_more`, add pagination + project filter + time presets + URL sync via `useSearchParams` |
41
- | `CLAUDE.md` | line 184 | Restore frontend description to React 18 + Vite + Tailwind + react-router-dom + react-query + Recharts |
42
- | `src/claudemd/claudemd-generator.ts` | line 737 | Same correction in the embedded template (escaped backtick) |
43
-
44
- ### New Files
45
-
46
- | File | Purpose |
47
- |------|---------|
48
- | `tests/unit/web/tasks-component-contract.test.ts` | Safety-net: 15 tests locking the `{ items, total, has_more }` API contract and documenting the broken consumer behaviour |
49
-
50
- ### Key Code Fix
51
-
52
- Before (broken):
53
- ```typescript
54
- async function fetchTasks(): Promise<Task[]> {
55
- const res = await fetch('/api/tasks')
56
- if (!res.ok) throw new Error('Failed to fetch tasks')
57
- return res.json() // returns TaskPage object, not Task[]
58
- }
59
- // ...
60
- const { data: tasks } = useQuery({ queryFn: fetchTasks })
61
- tasks.filter(...) // TypeError: tasks.filter is not a function
62
- ```
63
-
64
- After (fixed):
65
- ```typescript
66
- async function fetchTasks(params: URLSearchParams): Promise<TaskPage> {
67
- const res = await fetch(`/api/tasks?${params.toString()}`)
68
- if (!res.ok) throw new Error('Failed to fetch tasks')
69
- return res.json() as Promise<TaskPage>
70
- }
71
- // ...
72
- const { data } = useQuery({ queryFn: () => fetchTasks(queryParams) })
73
- const tasks = data?.items ?? [] // correct: array from paginated wrapper
74
- const total = data?.total ?? 0
75
- ```
76
-
77
- ---
78
-
79
- ## New Tests (Safety-Net)
80
-
81
- File: `tests/unit/web/tasks-component-contract.test.ts`
82
-
83
- 15 tests in 4 groups:
84
- 1. **API response shape** (5 tests) — asserts `{ items, total, has_more }` structure
85
- 2. **[CHAR] broken consumer** (2 tests) — documents the pre-fix white screen defect: `consumeTasksResponseBROKEN` returns object not array, `.filter()` throws `TypeError`
86
- 3. **Correct consumer** (5 tests) — contract the fix satisfies: array extraction, field access, empty page
87
- 4. **Pagination parameters** (3 tests) — default limit 50, valid page sizes [20, 50, 100], offset formula
88
-
89
- ---
90
-
91
- ## Regression Test Results
92
-
93
- ```
94
- Test Files 1 failed | 28 passed (29)
95
- Tests 1 failed | 338 passed (339)
96
- ```
97
-
98
- The 1 pre-existing failure (`sqlite-refactor-harness.test.ts:166 linkEventToTask`) was present before this hotfix and is unrelated (UUID validation in test fixture). 15 new safety-net tests all pass.
99
-
100
- ---
101
-
102
- ## Build Evidence
103
-
104
- ```
105
- web/dist/assets/Tasks-D98y3WV2.js (3.xx kB — new chunk)
106
- dist/web/static/assets/Tasks-D98y3WV2.js (copied to production path)
107
- ```
108
-
109
- `curl -sI http://127.0.0.1:3721/` → `200 OK`
110
- `curl -s http://127.0.0.1:3721/ | grep -c "vite|module"` → `8` (React app, not vanilla HTML)
111
- `curl -s "http://127.0.0.1:3721/api/tasks?limit=1"` → `{"items":[...],"total":393,"has_more":true}`
112
-
113
- ---
114
-
115
- ## Verification Checklist
116
-
117
- - [x] `web/` TypeScript: `npx tsc --noEmit` → 0 errors
118
- - [x] Root TypeScript: `npx tsc --noEmit` → 0 errors
119
- - [x] `web/npm run build` → succeeds, Tasks chunk present
120
- - [x] Root `npm run build` → succeeds, chunk copied to `dist/web/static/assets/`
121
- - [x] Safety-net tests: 15/15 pass
122
- - [x] Full suite: 338/339 pass (pre-existing failure unrelated)
123
- - [x] `curl http://127.0.0.1:3721/` → 200 OK, HTML contains vite module references
124
- - [x] API returns `{ items, total, has_more }` shape confirmed
125
- - [x] `CLAUDE.md` and `claudemd-generator.ts` frontend description corrected
126
- - [ ] Daemon restart (requires manual: `./scripts/dev-daemon.sh restart`)