retestkit 1.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (327) hide show
  1. package/.claude/commands/openspec/apply.md +23 -0
  2. package/.claude/commands/openspec/archive.md +27 -0
  3. package/.claude/commands/openspec/proposal.md +28 -0
  4. package/.gemini/commands/openspec/apply.toml +21 -0
  5. package/.gemini/commands/openspec/archive.toml +25 -0
  6. package/.gemini/commands/openspec/proposal.toml +26 -0
  7. package/.github/prompts/openspec-apply.prompt.md +22 -0
  8. package/.github/prompts/openspec-archive.prompt.md +26 -0
  9. package/.github/prompts/openspec-proposal.prompt.md +27 -0
  10. package/.github/workflows/release.yml +33 -0
  11. package/.kilocode/workflows/openspec-apply.md +17 -0
  12. package/.kilocode/workflows/openspec-archive.md +21 -0
  13. package/.kilocode/workflows/openspec-proposal.md +22 -0
  14. package/.mcp.json +23 -0
  15. package/.opencode/command/openspec-apply.md +25 -0
  16. package/.opencode/command/openspec-archive.md +28 -0
  17. package/.opencode/command/openspec-proposal.md +30 -0
  18. package/.roo/commands/openspec-apply.md +20 -0
  19. package/.roo/commands/openspec-archive.md +24 -0
  20. package/.roo/commands/openspec-proposal.md +25 -0
  21. package/.vscode/mcp.json +23 -0
  22. package/AGENTS.md +18 -0
  23. package/CLAUDE.md +18 -0
  24. package/LICENSE +65 -0
  25. package/README.md +303 -0
  26. package/dist/config.d.ts +4 -0
  27. package/dist/config.d.ts.map +1 -0
  28. package/dist/config.js +27 -0
  29. package/dist/config.js.map +1 -0
  30. package/dist/elicitation/index.d.ts +17 -0
  31. package/dist/elicitation/index.d.ts.map +1 -0
  32. package/dist/elicitation/index.js +118 -0
  33. package/dist/elicitation/index.js.map +1 -0
  34. package/dist/elicitation/types.d.ts +35 -0
  35. package/dist/elicitation/types.d.ts.map +1 -0
  36. package/dist/elicitation/types.js +39 -0
  37. package/dist/elicitation/types.js.map +1 -0
  38. package/dist/index.d.ts +3 -0
  39. package/dist/index.d.ts.map +1 -0
  40. package/dist/index.js +76 -0
  41. package/dist/index.js.map +1 -0
  42. package/dist/lifecycle/index.d.ts +31 -0
  43. package/dist/lifecycle/index.d.ts.map +1 -0
  44. package/dist/lifecycle/index.js +61 -0
  45. package/dist/lifecycle/index.js.map +1 -0
  46. package/dist/logger.d.ts +21 -0
  47. package/dist/logger.d.ts.map +1 -0
  48. package/dist/logger.js +182 -0
  49. package/dist/logger.js.map +1 -0
  50. package/dist/playwright-client/index.d.ts +29 -0
  51. package/dist/playwright-client/index.d.ts.map +1 -0
  52. package/dist/playwright-client/index.js +288 -0
  53. package/dist/playwright-client/index.js.map +1 -0
  54. package/dist/playwright-client/types.d.ts +44 -0
  55. package/dist/playwright-client/types.d.ts.map +1 -0
  56. package/dist/playwright-client/types.js +49 -0
  57. package/dist/playwright-client/types.js.map +1 -0
  58. package/dist/progress/index.d.ts +39 -0
  59. package/dist/progress/index.d.ts.map +1 -0
  60. package/dist/progress/index.js +106 -0
  61. package/dist/progress/index.js.map +1 -0
  62. package/dist/progress/types.d.ts +24 -0
  63. package/dist/progress/types.d.ts.map +1 -0
  64. package/dist/progress/types.js +2 -0
  65. package/dist/progress/types.js.map +1 -0
  66. package/dist/prompts/index.d.ts +19 -0
  67. package/dist/prompts/index.d.ts.map +1 -0
  68. package/dist/prompts/index.js +207 -0
  69. package/dist/prompts/index.js.map +1 -0
  70. package/dist/prompts/loader.d.ts +20 -0
  71. package/dist/prompts/loader.d.ts.map +1 -0
  72. package/dist/prompts/loader.js +47 -0
  73. package/dist/prompts/loader.js.map +1 -0
  74. package/dist/resources/index.d.ts +27 -0
  75. package/dist/resources/index.d.ts.map +1 -0
  76. package/dist/resources/index.js +186 -0
  77. package/dist/resources/index.js.map +1 -0
  78. package/dist/resources/subscriptions.d.ts +10 -0
  79. package/dist/resources/subscriptions.d.ts.map +1 -0
  80. package/dist/resources/subscriptions.js +23 -0
  81. package/dist/resources/subscriptions.js.map +1 -0
  82. package/dist/sampling/index.d.ts +11 -0
  83. package/dist/sampling/index.d.ts.map +1 -0
  84. package/dist/sampling/index.js +201 -0
  85. package/dist/sampling/index.js.map +1 -0
  86. package/dist/sampling/prompts.d.ts +56 -0
  87. package/dist/sampling/prompts.d.ts.map +1 -0
  88. package/dist/sampling/prompts.js +124 -0
  89. package/dist/sampling/prompts.js.map +1 -0
  90. package/dist/sampling/types.d.ts +57 -0
  91. package/dist/sampling/types.d.ts.map +1 -0
  92. package/dist/sampling/types.js +2 -0
  93. package/dist/sampling/types.js.map +1 -0
  94. package/dist/schemas/config.d.ts +40 -0
  95. package/dist/schemas/config.d.ts.map +1 -0
  96. package/dist/schemas/config.js +30 -0
  97. package/dist/schemas/config.js.map +1 -0
  98. package/dist/security/index.d.ts +38 -0
  99. package/dist/security/index.d.ts.map +1 -0
  100. package/dist/security/index.js +281 -0
  101. package/dist/security/index.js.map +1 -0
  102. package/dist/server.d.ts +9 -0
  103. package/dist/server.d.ts.map +1 -0
  104. package/dist/server.js +142 -0
  105. package/dist/server.js.map +1 -0
  106. package/dist/test-utils/index.d.ts +6 -0
  107. package/dist/test-utils/index.d.ts.map +1 -0
  108. package/dist/test-utils/index.js +6 -0
  109. package/dist/test-utils/index.js.map +1 -0
  110. package/dist/test-utils/mock-context.d.ts +64 -0
  111. package/dist/test-utils/mock-context.d.ts.map +1 -0
  112. package/dist/test-utils/mock-context.js +347 -0
  113. package/dist/test-utils/mock-context.js.map +1 -0
  114. package/dist/test-utils/mock-playwright-client.d.ts +62 -0
  115. package/dist/test-utils/mock-playwright-client.d.ts.map +1 -0
  116. package/dist/test-utils/mock-playwright-client.js +315 -0
  117. package/dist/test-utils/mock-playwright-client.js.map +1 -0
  118. package/dist/tools/index.d.ts +4 -0
  119. package/dist/tools/index.d.ts.map +1 -0
  120. package/dist/tools/index.js +8 -0
  121. package/dist/tools/index.js.map +1 -0
  122. package/dist/tools/webtest/crawl.d.ts +46 -0
  123. package/dist/tools/webtest/crawl.d.ts.map +1 -0
  124. package/dist/tools/webtest/crawl.js +678 -0
  125. package/dist/tools/webtest/crawl.js.map +1 -0
  126. package/dist/tools/webtest/discover-features.d.ts +30 -0
  127. package/dist/tools/webtest/discover-features.d.ts.map +1 -0
  128. package/dist/tools/webtest/discover-features.js +343 -0
  129. package/dist/tools/webtest/discover-features.js.map +1 -0
  130. package/dist/tools/webtest/discover-flows.d.ts +29 -0
  131. package/dist/tools/webtest/discover-flows.d.ts.map +1 -0
  132. package/dist/tools/webtest/discover-flows.js +341 -0
  133. package/dist/tools/webtest/discover-flows.js.map +1 -0
  134. package/dist/tools/webtest/generate-tests.d.ts +54 -0
  135. package/dist/tools/webtest/generate-tests.d.ts.map +1 -0
  136. package/dist/tools/webtest/generate-tests.js +364 -0
  137. package/dist/tools/webtest/generate-tests.js.map +1 -0
  138. package/dist/tools/webtest/index.d.ts +8 -0
  139. package/dist/tools/webtest/index.d.ts.map +1 -0
  140. package/dist/tools/webtest/index.js +8 -0
  141. package/dist/tools/webtest/index.js.map +1 -0
  142. package/dist/tools/webtest/run-test-case.d.ts +28 -0
  143. package/dist/tools/webtest/run-test-case.d.ts.map +1 -0
  144. package/dist/tools/webtest/run-test-case.js +420 -0
  145. package/dist/tools/webtest/run-test-case.js.map +1 -0
  146. package/dist/tools/webtest/schemas.d.ts +175 -0
  147. package/dist/tools/webtest/schemas.d.ts.map +1 -0
  148. package/dist/tools/webtest/schemas.js +156 -0
  149. package/dist/tools/webtest/schemas.js.map +1 -0
  150. package/dist/tools/webtest/start-analysis.d.ts +16 -0
  151. package/dist/tools/webtest/start-analysis.d.ts.map +1 -0
  152. package/dist/tools/webtest/start-analysis.js +137 -0
  153. package/dist/tools/webtest/start-analysis.js.map +1 -0
  154. package/dist/transports/http.d.ts +8 -0
  155. package/dist/transports/http.d.ts.map +1 -0
  156. package/dist/transports/http.js +9 -0
  157. package/dist/transports/http.js.map +1 -0
  158. package/dist/transports/index.d.ts +14 -0
  159. package/dist/transports/index.d.ts.map +1 -0
  160. package/dist/transports/index.js +20 -0
  161. package/dist/transports/index.js.map +1 -0
  162. package/dist/transports/stdio.d.ts +4 -0
  163. package/dist/transports/stdio.d.ts.map +1 -0
  164. package/dist/transports/stdio.js +6 -0
  165. package/dist/transports/stdio.js.map +1 -0
  166. package/dist/types/capabilities.d.ts +18 -0
  167. package/dist/types/capabilities.d.ts.map +1 -0
  168. package/dist/types/capabilities.js +35 -0
  169. package/dist/types/capabilities.js.map +1 -0
  170. package/dist/types/context.d.ts +20 -0
  171. package/dist/types/context.d.ts.map +1 -0
  172. package/dist/types/context.js +2 -0
  173. package/dist/types/context.js.map +1 -0
  174. package/dist/types/tool.d.ts +10 -0
  175. package/dist/types/tool.d.ts.map +1 -0
  176. package/dist/types/tool.js +2 -0
  177. package/dist/types/tool.js.map +1 -0
  178. package/dist/workspace/index.d.ts +99 -0
  179. package/dist/workspace/index.d.ts.map +1 -0
  180. package/dist/workspace/index.js +648 -0
  181. package/dist/workspace/index.js.map +1 -0
  182. package/dist/workspace/markdown.d.ts +50 -0
  183. package/dist/workspace/markdown.d.ts.map +1 -0
  184. package/dist/workspace/markdown.js +210 -0
  185. package/dist/workspace/markdown.js.map +1 -0
  186. package/dist/workspace/types.d.ts +173 -0
  187. package/dist/workspace/types.d.ts.map +1 -0
  188. package/dist/workspace/types.js +2 -0
  189. package/dist/workspace/types.js.map +1 -0
  190. package/openspec/AGENTS.md +456 -0
  191. package/openspec/changes/archive/2025-12-18-add-hybrid-artifact-paths/proposal.md +33 -0
  192. package/openspec/changes/archive/2025-12-18-add-hybrid-artifact-paths/specs/webtest-resources/spec.md +27 -0
  193. package/openspec/changes/archive/2025-12-18-add-hybrid-artifact-paths/specs/webtest-tools/spec.md +304 -0
  194. package/openspec/changes/archive/2025-12-18-add-hybrid-artifact-paths/tasks.md +43 -0
  195. package/openspec/changes/archive/2025-12-18-add-mcp-server-foundation/design.md +209 -0
  196. package/openspec/changes/archive/2025-12-18-add-mcp-server-foundation/proposal.md +41 -0
  197. package/openspec/changes/archive/2025-12-18-add-mcp-server-foundation/specs/mcp-server-core/spec.md +183 -0
  198. package/openspec/changes/archive/2025-12-18-add-mcp-server-foundation/tasks.md +112 -0
  199. package/openspec/changes/archive/2025-12-18-add-webtest-orchestrator/design.md +333 -0
  200. package/openspec/changes/archive/2025-12-18-add-webtest-orchestrator/proposal.md +66 -0
  201. package/openspec/changes/archive/2025-12-18-add-webtest-orchestrator/specs/mcp-server-core/spec.md +129 -0
  202. package/openspec/changes/archive/2025-12-18-add-webtest-orchestrator/specs/webtest-lifecycle/spec.md +138 -0
  203. package/openspec/changes/archive/2025-12-18-add-webtest-orchestrator/specs/webtest-logging/spec.md +211 -0
  204. package/openspec/changes/archive/2025-12-18-add-webtest-orchestrator/specs/webtest-prompts/spec.md +157 -0
  205. package/openspec/changes/archive/2025-12-18-add-webtest-orchestrator/specs/webtest-resources/spec.md +213 -0
  206. package/openspec/changes/archive/2025-12-18-add-webtest-orchestrator/specs/webtest-sampling/spec.md +257 -0
  207. package/openspec/changes/archive/2025-12-18-add-webtest-orchestrator/specs/webtest-tools/spec.md +501 -0
  208. package/openspec/changes/archive/2025-12-18-add-webtest-orchestrator/tasks.md +264 -0
  209. package/openspec/changes/archive/2025-12-18-allow-analysis-of-incomplete-crawls/proposal.md +24 -0
  210. package/openspec/changes/archive/2025-12-18-allow-analysis-of-incomplete-crawls/specs/webtest-tools/spec.md +80 -0
  211. package/openspec/changes/archive/2025-12-18-allow-analysis-of-incomplete-crawls/tasks.md +8 -0
  212. package/openspec/changes/archive/2025-12-18-fix-crawl-loop-stability/design.md +90 -0
  213. package/openspec/changes/archive/2025-12-18-fix-crawl-loop-stability/proposal.md +28 -0
  214. package/openspec/changes/archive/2025-12-18-fix-crawl-loop-stability/specs/webtest-sampling/spec.md +90 -0
  215. package/openspec/changes/archive/2025-12-18-fix-crawl-loop-stability/tasks.md +33 -0
  216. package/openspec/changes/archive/2025-12-18-use-markdown-artifacts/design.md +558 -0
  217. package/openspec/changes/archive/2025-12-18-use-markdown-artifacts/proposal.md +119 -0
  218. package/openspec/changes/archive/2025-12-18-use-markdown-artifacts/specs/webtest-resources/spec.md +109 -0
  219. package/openspec/changes/archive/2025-12-18-use-markdown-artifacts/specs/webtest-tools/spec.md +121 -0
  220. package/openspec/changes/archive/2025-12-18-use-markdown-artifacts/tasks.md +133 -0
  221. package/openspec/changes/extract-prompts-to-markdown/design.md +86 -0
  222. package/openspec/changes/extract-prompts-to-markdown/proposal.md +50 -0
  223. package/openspec/changes/extract-prompts-to-markdown/specs/webtest-prompts/spec.md +74 -0
  224. package/openspec/changes/extract-prompts-to-markdown/tasks.md +40 -0
  225. package/openspec/changes/refactor-webtest-naming/design.md +95 -0
  226. package/openspec/changes/refactor-webtest-naming/proposal.md +66 -0
  227. package/openspec/changes/refactor-webtest-naming/specs/webtest-prompts/spec.md +79 -0
  228. package/openspec/changes/refactor-webtest-naming/specs/webtest-resources/spec.md +80 -0
  229. package/openspec/changes/refactor-webtest-naming/specs/webtest-sampling/spec.md +122 -0
  230. package/openspec/changes/refactor-webtest-naming/specs/webtest-tools/spec.md +113 -0
  231. package/openspec/changes/refactor-webtest-naming/tasks.md +119 -0
  232. package/openspec/changes/rename-package-to-retest/proposal.md +52 -0
  233. package/openspec/changes/rename-package-to-retest/specs/mcp-server-core/spec.md +53 -0
  234. package/openspec/changes/rename-package-to-retest/specs/retest-lifecycle/spec.md +68 -0
  235. package/openspec/changes/rename-package-to-retest/specs/retest-logging/spec.md +35 -0
  236. package/openspec/changes/rename-package-to-retest/specs/retest-prompts/spec.md +159 -0
  237. package/openspec/changes/rename-package-to-retest/specs/retest-resources/spec.md +251 -0
  238. package/openspec/changes/rename-package-to-retest/specs/retest-sampling/spec.md +99 -0
  239. package/openspec/changes/rename-package-to-retest/specs/retest-tools/spec.md +295 -0
  240. package/openspec/changes/rename-package-to-retest/tasks.md +71 -0
  241. package/openspec/project.md +31 -0
  242. package/openspec/specs/mcp-server-core/spec.md +178 -0
  243. package/openspec/specs/webtest-lifecycle/spec.md +136 -0
  244. package/openspec/specs/webtest-logging/spec.md +209 -0
  245. package/openspec/specs/webtest-prompts/spec.md +155 -0
  246. package/openspec/specs/webtest-resources/spec.md +248 -0
  247. package/openspec/specs/webtest-sampling/spec.md +344 -0
  248. package/openspec/specs/webtest-tools/spec.md +282 -0
  249. package/package.json +54 -0
  250. package/release.config.js +9 -0
  251. package/src/config.test.ts +96 -0
  252. package/src/config.ts +32 -0
  253. package/src/elicitation/index.test.ts +399 -0
  254. package/src/elicitation/index.ts +171 -0
  255. package/src/elicitation/types.ts +68 -0
  256. package/src/index.ts +83 -0
  257. package/src/lifecycle/index.test.ts +260 -0
  258. package/src/lifecycle/index.ts +101 -0
  259. package/src/logger.redaction.test.ts +322 -0
  260. package/src/logger.test.ts +123 -0
  261. package/src/logger.ts +229 -0
  262. package/src/playwright-client/index.ts +392 -0
  263. package/src/playwright-client/types.ts +99 -0
  264. package/src/progress/index.test.ts +327 -0
  265. package/src/progress/index.ts +170 -0
  266. package/src/progress/types.ts +25 -0
  267. package/src/prompts/index.test.ts +451 -0
  268. package/src/prompts/index.ts +246 -0
  269. package/src/prompts/loader.test.ts +100 -0
  270. package/src/prompts/loader.ts +59 -0
  271. package/src/prompts/templates/mcp/webtest-crawl.md +7 -0
  272. package/src/prompts/templates/mcp/webtest-discover-flows.md +11 -0
  273. package/src/prompts/templates/mcp/webtest-discover.md +12 -0
  274. package/src/prompts/templates/mcp/webtest-full-workflow.md +12 -0
  275. package/src/prompts/templates/mcp/webtest-generate-tests.md +11 -0
  276. package/src/prompts/templates/mcp/webtest-run-test.md +11 -0
  277. package/src/prompts/templates/mcp/webtest-start.md +8 -0
  278. package/src/prompts/templates/sampling/crawl-action.md +35 -0
  279. package/src/prompts/templates/sampling/feature-discovery.md +27 -0
  280. package/src/prompts/templates/sampling/flow-discovery.md +29 -0
  281. package/src/prompts/templates/sampling/page-content-wrapper.md +5 -0
  282. package/src/prompts/templates/sampling/system-prefix.md +12 -0
  283. package/src/prompts/templates/sampling/test-evaluation.md +17 -0
  284. package/src/prompts/templates/sampling/test-generation.md +31 -0
  285. package/src/resources/index.ts +250 -0
  286. package/src/resources/subscriptions.ts +37 -0
  287. package/src/sampling/index.test.ts +414 -0
  288. package/src/sampling/index.ts +286 -0
  289. package/src/sampling/prompts.ts +194 -0
  290. package/src/sampling/types.ts +60 -0
  291. package/src/schemas/config.ts +39 -0
  292. package/src/security/index.test.ts +441 -0
  293. package/src/security/index.ts +361 -0
  294. package/src/security/security-scenarios.test.ts +468 -0
  295. package/src/server.ts +211 -0
  296. package/src/test-utils/index.ts +6 -0
  297. package/src/test-utils/mock-context.ts +426 -0
  298. package/src/test-utils/mock-playwright-client.ts +422 -0
  299. package/src/tools/index.ts +11 -0
  300. package/src/tools/webtest/crawl.test.ts +834 -0
  301. package/src/tools/webtest/crawl.ts +901 -0
  302. package/src/tools/webtest/discover-features.ts +412 -0
  303. package/src/tools/webtest/discover-flows.ts +408 -0
  304. package/src/tools/webtest/generate-tests.test.ts +532 -0
  305. package/src/tools/webtest/generate-tests.ts +425 -0
  306. package/src/tools/webtest/index.ts +7 -0
  307. package/src/tools/webtest/integration.test.ts +536 -0
  308. package/src/tools/webtest/run-test-case.test.ts +659 -0
  309. package/src/tools/webtest/run-test-case.ts +508 -0
  310. package/src/tools/webtest/schemas.ts +201 -0
  311. package/src/tools/webtest/start-analysis.test.ts +151 -0
  312. package/src/tools/webtest/start-analysis.ts +158 -0
  313. package/src/transports/http.ts +19 -0
  314. package/src/transports/index.ts +30 -0
  315. package/src/transports/stdio.ts +7 -0
  316. package/src/types/capabilities.test.ts +193 -0
  317. package/src/types/capabilities.ts +50 -0
  318. package/src/types/context.ts +21 -0
  319. package/src/types/tool.ts +11 -0
  320. package/src/workspace/index.ts +945 -0
  321. package/src/workspace/markdown.ts +272 -0
  322. package/src/workspace/types.ts +186 -0
  323. package/tests/integration/server.test.ts +89 -0
  324. package/tests/integration/tools.test.ts +99 -0
  325. package/tsconfig.json +20 -0
  326. package/vitest.config.ts +9 -0
  327. package/vitest.integration.config.ts +10 -0
@@ -0,0 +1,52 @@
1
+ # Proposal: Rename Package to Retest
2
+
3
+ ## Why
4
+
5
+ The current naming (`testing-mcp`, `webtest_*` tools, `webtest://` resources) is verbose and inconsistent. A unified "retest" brand simplifies the user experience, makes the CLI and tool names more memorable, and establishes a clear product identity.
6
+
7
+ ## What Changes
8
+
9
+ - **BREAKING**: Rename npm package from `@jan-beranek/testing-mcp` to `@jan-beranek/retest`
10
+ - **BREAKING**: Reset version to `0.0.1` (fresh start for the new brand)
11
+ - **BREAKING**: Rename all tool prefixes from `webtest_*` to `retest_*`
12
+ - **BREAKING**: Rename all prompt names from `webtest-*` to `retest-*`
13
+ - **BREAKING**: Rename resource URI scheme from `webtest://` to `retest://`
14
+ - **BREAKING**: Rename environment variable from `WEBTEST_WORKSPACE_DIR` to `RETEST_WORKSPACE_DIR`
15
+ - **BREAKING**: Rename system prefix token from `[WEBTEST-SYSTEM]:` to `[RETEST-SYSTEM]:`
16
+ - Rename source directory from `src/tools/webtest/` to `src/tools/retest/`
17
+ - Rename prompt template files from `webtest-*.md` to `retest-*.md`
18
+ - Rename default workspace directory from `webtest-workspaces` to `retest-workspaces`
19
+ - Update CLI binary name from `testing-mcp` to `retest`
20
+ - Update MCP server name to `retest`
21
+ - Rename all OpenSpec specs from `webtest-*` to `retest-*`
22
+
23
+ ## Impact
24
+
25
+ ### Specifications Affected
26
+ - `webtest-tools` → `retest-tools` (all tool definitions)
27
+ - `webtest-prompts` → `retest-prompts` (all prompt definitions)
28
+ - `webtest-resources` → `retest-resources` (URI scheme and resource patterns)
29
+ - `webtest-sampling` → `retest-sampling` (system prefix token)
30
+ - `webtest-logging` → `retest-logging` (logger name)
31
+ - `webtest-lifecycle` → `retest-lifecycle` (workspace directory)
32
+ - `mcp-server-core` (package name, binary, server name)
33
+
34
+ ### Code Files Affected
35
+ - `package.json` - name, version, bin
36
+ - `src/server.ts` - server name, imports
37
+ - `src/tools/webtest/` → `src/tools/retest/` - directory and all files
38
+ - `src/tools/index.ts` - import path
39
+ - `src/prompts/index.ts` - function names, prompt names
40
+ - `src/prompts/templates/mcp/webtest-*.md` → `retest-*.md`
41
+ - `src/prompts/templates/sampling/system-prefix.md`
42
+ - `src/resources/index.ts` - URI scheme
43
+ - `src/config.ts` - environment variable
44
+ - `src/schemas/config.ts` - default directory
45
+ - `src/security/index.ts` - system prefix regex
46
+ - `src/sampling/index.ts` - system prefix references
47
+ - `src/workspace/types.ts` - comments
48
+ - `src/logger.ts` - logger name
49
+ - `src/test-utils/mock-context.ts` - test directory
50
+ - All test files with hardcoded tool/prompt names
51
+ - `README.md` - documentation
52
+ - `.gitignore` - workspace directory pattern
@@ -0,0 +1,53 @@
1
+ # mcp-server-core Specification Delta
2
+
3
+ ## MODIFIED Requirements
4
+
5
+ ### Requirement: MCP Server Initialization
6
+
7
+ The system SHALL provide an MCP server that initializes with proper identification and connects to the configured transport.
8
+
9
+ #### Scenario: Server starts with stdio transport
10
+
11
+ - **GIVEN** the environment variable `TRANSPORT` is set to `stdio` or not set
12
+ - **WHEN** the server entry point is executed
13
+ - **THEN** it SHALL identify itself with name "retest" and version from package.json
14
+ - **AND** it SHALL connect to stdio transport for communication
15
+
16
+ #### Scenario: Server starts with HTTP transport
17
+
18
+ - **GIVEN** the environment variable `TRANSPORT` is set to `http`
19
+ - **AND** the environment variable `PORT` is set to a valid port number
20
+ - **WHEN** the server entry point is executed
21
+ - **THEN** it SHALL start a Streamable HTTP server on the specified port
22
+ - **AND** it SHALL accept MCP protocol connections over HTTP
23
+
24
+ #### Scenario: Server handles graceful shutdown
25
+
26
+ - **GIVEN** the server is running
27
+ - **WHEN** the process receives SIGINT or SIGTERM
28
+ - **THEN** the server SHALL disconnect gracefully
29
+ - **AND** the process SHALL exit with code 0
30
+
31
+ ### Requirement: Project Build Configuration
32
+
33
+ The system SHALL be buildable to JavaScript for production deployment using TypeScript compiler.
34
+
35
+ #### Scenario: Project builds successfully
36
+
37
+ - **GIVEN** the source code is valid TypeScript
38
+ - **WHEN** `npm run build` is executed
39
+ - **THEN** compiled JavaScript SHALL be output to `dist/` directory
40
+ - **AND** the build SHALL complete without errors
41
+
42
+ #### Scenario: Development mode runs with hot-reload
43
+
44
+ - **GIVEN** the development dependencies are installed
45
+ - **WHEN** `npm run dev` is executed
46
+ - **THEN** the server SHALL start with file watching enabled
47
+ - **AND** changes to source files SHALL trigger automatic restart
48
+
49
+ #### Scenario: Package is executable as CLI
50
+
51
+ - **GIVEN** the project is built
52
+ - **WHEN** `npx @jan-beranek/retest` is executed (or the bin entry is invoked)
53
+ - **THEN** the server SHALL start with default configuration
@@ -0,0 +1,68 @@
1
+ # retest-lifecycle Specification Delta
2
+
3
+ ## RENAMED Requirements
4
+
5
+ - **FROM**: `webtest-lifecycle` specification
6
+ - **TO**: `retest-lifecycle` specification
7
+
8
+ ## MODIFIED Requirements
9
+
10
+ ### Requirement: Client Capability Negotiation
11
+
12
+ The system SHALL query and record client capabilities during initialization and adapt behavior accordingly.
13
+
14
+ #### Scenario: Server records sampling capability
15
+
16
+ - **GIVEN** a client connects with `capabilities.sampling` present
17
+ - **WHEN** initialization completes
18
+ - **THEN** the server SHALL record that sampling is available
19
+ - **AND** retest tools SHALL use `sampling/createMessage` for LLM reasoning
20
+
21
+ #### Scenario: Server records elicitation capability
22
+
23
+ - **GIVEN** a client connects with `capabilities.elicitation` present
24
+ - **WHEN** initialization completes
25
+ - **THEN** the server SHALL record that elicitation is available
26
+ - **AND** retest tools SHALL use `elicitation/create` for user decisions
27
+
28
+ #### Scenario: Server records logging capability
29
+
30
+ - **GIVEN** a client connects with `capabilities.logging` present
31
+ - **WHEN** initialization completes
32
+ - **THEN** the server SHALL record that logging notifications are supported
33
+ - **AND** the logger SHALL emit `notifications/message` to the client
34
+
35
+ #### Scenario: Server records progress capability
36
+
37
+ - **GIVEN** a client connects with MCP progress support
38
+ - **WHEN** initialization completes
39
+ - **THEN** the server SHALL record that progress notifications are supported
40
+ - **AND** long-running tools SHALL emit `notifications/progress`
41
+
42
+ #### Scenario: Server records resources listChanged capability
43
+
44
+ - **GIVEN** a client connects with `capabilities.resources.listChanged` present
45
+ - **WHEN** initialization completes
46
+ - **THEN** the server SHALL record that resource list change notifications are supported
47
+ - **AND** resource creation SHALL emit `notifications/resources/list_changed`
48
+
49
+ #### Scenario: Server records resources subscribe capability
50
+
51
+ - **GIVEN** a client connects with `capabilities.resources.subscribe` present
52
+ - **WHEN** initialization completes
53
+ - **THEN** the server SHALL record that resource subscriptions are supported
54
+ - **AND** resource updates SHALL emit `notifications/resources/updated` to subscribers
55
+
56
+ #### Scenario: Fallback when sampling not supported
57
+
58
+ - **GIVEN** a client connects without `capabilities.sampling`
59
+ - **WHEN** a retest tool requires LLM reasoning
60
+ - **THEN** the tool SHALL return a prompt resource for manual execution
61
+ - **AND** the tool output SHALL include `needsManualInput: true`
62
+
63
+ #### Scenario: Fallback when elicitation not supported
64
+
65
+ - **GIVEN** a client connects without `capabilities.elicitation`
66
+ - **WHEN** a retest tool needs user decision
67
+ - **THEN** the tool SHALL include questions in its output
68
+ - **AND** the tool output SHALL include `needsInput: true` with question details
@@ -0,0 +1,35 @@
1
+ # retest-logging Specification Delta
2
+
3
+ ## RENAMED Requirements
4
+
5
+ - **FROM**: `webtest-logging` specification
6
+ - **TO**: `retest-logging` specification
7
+
8
+ ## MODIFIED Requirements
9
+
10
+ ### Requirement: MCP Logging Notifications
11
+
12
+ The system SHALL emit structured logs as MCP logging notifications when the client supports it.
13
+
14
+ #### Scenario: Log emitted as MCP notification
15
+
16
+ - **GIVEN** the client supports MCP logging (`capabilities.logging` present)
17
+ - **WHEN** a log event occurs
18
+ - **THEN** it SHALL emit `notifications/message` with:
19
+ - `level`: one of "debug", "info", "warning", "error"
20
+ - `logger`: "retest"
21
+ - `data`: structured log payload
22
+
23
+ #### Scenario: Fallback to stderr when logging unsupported
24
+
25
+ - **GIVEN** the client does not support MCP logging
26
+ - **WHEN** a log event occurs
27
+ - **THEN** it SHALL write to stderr as JSON
28
+ - **AND** not attempt MCP notification
29
+
30
+ #### Scenario: Log level is respected
31
+
32
+ - **GIVEN** client log level is set to "warning"
33
+ - **WHEN** an "info" level log is generated
34
+ - **THEN** it SHALL NOT be emitted
35
+ - **AND** "warning" and "error" logs SHALL be emitted
@@ -0,0 +1,159 @@
1
+ # retest-prompts Specification Delta
2
+
3
+ ## RENAMED Requirements
4
+
5
+ - **FROM**: `webtest-prompts` specification
6
+ - **TO**: `retest-prompts` specification
7
+
8
+ ## MODIFIED Requirements
9
+
10
+ ### Requirement: Prompt Template Registration
11
+
12
+ The system SHALL register prompt templates with the MCP server for client discovery.
13
+
14
+ #### Scenario: Prompts are listed on prompts/list
15
+
16
+ - **GIVEN** a client calls `prompts/list`
17
+ - **WHEN** the response is returned
18
+ - **THEN** it SHALL include prompts:
19
+ - `retest-start` (Start web testing analysis)
20
+ - `retest-crawl` (Crawl to satisfy focus)
21
+ - `retest-discover` (Discover features and flows)
22
+ - `retest-generate-tests` (Generate test cases)
23
+ - `retest-run-test` (Run a test case)
24
+ - `retest-full-workflow` (Full testing workflow)
25
+
26
+ ### Requirement: Start Analysis Prompt
27
+
28
+ The system SHALL provide a prompt template to initiate a web testing analysis.
29
+
30
+ #### Scenario: Start analysis prompt is invoked
31
+
32
+ - **GIVEN** client invokes `prompts/get` with name `retest-start`
33
+ - **WHEN** the prompt is returned
34
+ - **THEN** it SHALL include:
35
+ - Description: "Start a new web testing analysis for a URL"
36
+ - Arguments: `url` (required), `focus` (required), `maxSteps` (optional), `maxPages` (optional)
37
+
38
+ #### Scenario: Start analysis prompt generates tool call
39
+
40
+ - **GIVEN** client invokes the prompt with arguments
41
+ - **WHEN** the prompt messages are returned
42
+ - **THEN** it SHALL include a user message instructing to call `retest_init`
43
+ - **AND** include the provided arguments in the instruction
44
+
45
+ ### Requirement: Crawl Prompt
46
+
47
+ The system SHALL provide a prompt template to start or continue a crawl.
48
+
49
+ #### Scenario: Crawl prompt is invoked
50
+
51
+ - **GIVEN** client invokes `prompts/get` with name `retest-crawl`
52
+ - **WHEN** the prompt is returned
53
+ - **THEN** it SHALL include:
54
+ - Description: "Crawl a web application to explore and achieve a goal"
55
+ - Arguments: `analysisId` (required), `goal` (optional), `strategy` (optional)
56
+
57
+ #### Scenario: Crawl prompt uses analysis goal by default
58
+
59
+ - **GIVEN** client invokes crawl prompt with only `analysisId`
60
+ - **WHEN** the prompt messages are returned
61
+ - **THEN** it SHALL instruct to use the original focus as the crawl goal
62
+
63
+ ### Requirement: Discover Prompt
64
+
65
+ The system SHALL provide a prompt template to discover features and flows.
66
+
67
+ #### Scenario: Discover prompt is invoked
68
+
69
+ - **GIVEN** client invokes `prompts/get` with name `retest-discover`
70
+ - **WHEN** the prompt is returned
71
+ - **THEN** it SHALL include:
72
+ - Description: "Discover features and flows from crawled data"
73
+ - Arguments: `analysisId` (required), `crawlId` (optional)
74
+
75
+ #### Scenario: Discover prompt lists available crawls
76
+
77
+ - **GIVEN** client invokes discover prompt with only `analysisId`
78
+ - **WHEN** the prompt messages are returned
79
+ - **THEN** it SHALL include context about available crawls for that analysis
80
+
81
+ ### Requirement: Generate Tests Prompt
82
+
83
+ The system SHALL provide a prompt template to generate test cases.
84
+
85
+ #### Scenario: Generate tests prompt is invoked
86
+
87
+ - **GIVEN** client invokes `prompts/get` with name `retest-generate-tests`
88
+ - **WHEN** the prompt is returned
89
+ - **THEN** it SHALL include:
90
+ - Description: "Generate test cases from application analysis"
91
+ - Arguments: `analysisId` (required), `count` (optional), `types` (optional)
92
+
93
+ #### Scenario: Generate tests prompt offers strategy options
94
+
95
+ - **GIVEN** client invokes generate tests prompt
96
+ - **WHEN** the prompt messages are returned
97
+ - **THEN** it SHALL mention available test types: "smoke", "negative", "boundary", "integration"
98
+
99
+ ### Requirement: Run Test Prompt
100
+
101
+ The system SHALL provide a prompt template to execute a test case.
102
+
103
+ #### Scenario: Run test prompt is invoked
104
+
105
+ - **GIVEN** client invokes `prompts/get` with name `retest-run-test`
106
+ - **WHEN** the prompt is returned
107
+ - **THEN** it SHALL include:
108
+ - Description: "Execute a test case and capture results"
109
+ - Arguments: `analysisId` (required), `testCaseId` (required)
110
+
111
+ #### Scenario: Run test prompt lists available tests
112
+
113
+ - **GIVEN** client invokes run test prompt with only `analysisId`
114
+ - **WHEN** the prompt messages are returned
115
+ - **THEN** it SHALL include context about available test cases for that analysis
116
+
117
+ ### Requirement: Prompt Argument Validation
118
+
119
+ The system SHALL validate prompt arguments and return helpful errors.
120
+
121
+ #### Scenario: Missing required argument returns error
122
+
123
+ - **GIVEN** client invokes `retest-start` without `url`
124
+ - **WHEN** validation occurs
125
+ - **THEN** it SHALL return error indicating `url` is required
126
+
127
+ #### Scenario: Invalid analysisId returns error
128
+
129
+ - **GIVEN** client invokes a prompt with non-existent `analysisId`
130
+ - **WHEN** validation occurs
131
+ - **THEN** it SHALL return error indicating analysis not found
132
+
133
+ ### Requirement: Prompt Chaining Guidance
134
+
135
+ The system SHALL include guidance in prompt outputs for the recommended workflow sequence.
136
+
137
+ #### Scenario: Start analysis prompt suggests next step
138
+
139
+ - **GIVEN** client uses start analysis prompt
140
+ - **WHEN** the prompt messages are returned
141
+ - **THEN** they SHALL include guidance: "After analysis starts, use retest-crawl to explore the application"
142
+
143
+ #### Scenario: Crawl prompt suggests next step
144
+
145
+ - **GIVEN** client uses crawl prompt
146
+ - **WHEN** the prompt messages are returned
147
+ - **THEN** they SHALL include guidance: "After crawl completes, use retest-discover to identify features and flows"
148
+
149
+ #### Scenario: Discover prompt suggests next step
150
+
151
+ - **GIVEN** client uses discover prompt
152
+ - **WHEN** the prompt messages are returned
153
+ - **THEN** they SHALL include guidance: "After discovery, use retest-generate-tests to create test cases"
154
+
155
+ #### Scenario: Generate tests prompt suggests next step
156
+
157
+ - **GIVEN** client uses generate tests prompt
158
+ - **WHEN** the prompt messages are returned
159
+ - **THEN** they SHALL include guidance: "After test generation, use retest-run-test to execute individual test cases"
@@ -0,0 +1,251 @@
1
+ # retest-resources Specification Delta
2
+
3
+ ## RENAMED Requirements
4
+
5
+ - **FROM**: `webtest-resources` specification
6
+ - **TO**: `retest-resources` specification
7
+
8
+ ## MODIFIED Requirements
9
+
10
+ ### Requirement: Resource URI Scheme
11
+
12
+ The system SHALL expose all retest artifacts using a `retest://` URI scheme with hierarchical paths, using markdown format for all human-readable artifacts.
13
+
14
+ #### Scenario: Analysis root resource is accessible
15
+
16
+ - **GIVEN** an analysis has been started with analysisId "abc123"
17
+ - **WHEN** client requests resource `retest://abc123/`
18
+ - **THEN** it SHALL return the analysis `index.md` metadata as markdown with YAML frontmatter
19
+
20
+ #### Scenario: Crawl index resource is accessible
21
+
22
+ - **GIVEN** a crawl has completed with crawlId "crawl-001"
23
+ - **WHEN** client requests resource `retest://abc123/crawls/crawl-001/index.md`
24
+ - **THEN** it SHALL return the crawl index as markdown with YAML frontmatter containing page list and metadata
25
+
26
+ #### Scenario: Page artifacts are accessible by type
27
+
28
+ - **GIVEN** a page was captured with pageId "page-001"
29
+ - **WHEN** client requests `retest://abc123/crawls/crawl-001/pages/page-001/screenshot.png`
30
+ - **THEN** it SHALL return the screenshot image
31
+ - **AND** `snapshot.md` returns accessibility tree as formatted markdown with YAML frontmatter
32
+ - **AND** `dom.html` returns HTML content
33
+
34
+ #### Scenario: Crawl checkpoint is accessible
35
+
36
+ - **GIVEN** a crawl is in progress with checkpoint saved
37
+ - **WHEN** client requests `retest://abc123/crawls/crawl-001/checkpoint.md`
38
+ - **THEN** it SHALL return the checkpoint as markdown with YAML frontmatter containing crawl state
39
+
40
+ #### Scenario: Features report is accessible
41
+
42
+ - **GIVEN** discover_features has completed
43
+ - **WHEN** client requests `retest://abc123/features.md`
44
+ - **THEN** it SHALL return the markdown features report
45
+
46
+ #### Scenario: Feature flows are accessible
47
+
48
+ - **GIVEN** discover_flows has completed for a feature
49
+ - **WHEN** client requests `retest://abc123/features/{featureSlug}/flows.md`
50
+ - **THEN** it SHALL return user flows as markdown with YAML frontmatter containing structured flow definitions
51
+
52
+ #### Scenario: Tests are accessible
53
+
54
+ - **GIVEN** generate_tests has completed
55
+ - **WHEN** client requests `retest://abc123/tests/tests.md`
56
+ - **THEN** it SHALL return the test cases as markdown with YAML frontmatter containing structured test definitions
57
+
58
+ #### Scenario: Test run report is accessible
59
+
60
+ - **GIVEN** a test run has completed with runId "run-001"
61
+ - **WHEN** client requests `retest://abc123/runs/run-001/report.md`
62
+ - **THEN** it SHALL return the test execution report as markdown with YAML frontmatter containing structured results
63
+
64
+ #### Scenario: Test step snapshot is accessible
65
+
66
+ - **GIVEN** a test step has captured evidence
67
+ - **WHEN** client requests `retest://abc123/runs/run-001/steps/1/snapshot.md`
68
+ - **THEN** it SHALL return the accessibility snapshot as formatted markdown with YAML frontmatter
69
+
70
+ ### Requirement: Resource Template Registration
71
+
72
+ The system SHALL register resource templates with the MCP server for discovery, using markdown extensions for all index and report resources.
73
+
74
+ #### Scenario: Templates are listed on resources/list
75
+
76
+ - **GIVEN** a client calls `resources/list`
77
+ - **WHEN** the response is returned
78
+ - **THEN** it SHALL include templates for:
79
+ - `retest://{analysisId}/index.md` (Analysis index)
80
+ - `retest://{analysisId}/crawls/{crawlId}/index.md` (Crawl index)
81
+ - `retest://{analysisId}/crawls/{crawlId}/checkpoint.md` (Crawl checkpoint)
82
+ - `retest://{analysisId}/crawls/{crawlId}/pages/{pageId}/snapshot.md` (Page snapshot)
83
+ - `retest://{analysisId}/crawls/{crawlId}/pages/{pageId}/screenshot.png` (Page screenshot)
84
+ - `retest://{analysisId}/crawls/{crawlId}/pages/{pageId}/dom.html` (Page DOM)
85
+ - `retest://{analysisId}/features.md` (Features report)
86
+ - `retest://{analysisId}/features/{featureSlug}/flows.md` (Feature flows)
87
+ - `retest://{analysisId}/tests/tests.md` (Test definitions)
88
+ - `retest://{analysisId}/runs/{runId}/report.md` (Test run report)
89
+ - `retest://{analysisId}/runs/{runId}/steps/{stepNumber}/snapshot.md` (Step snapshot)
90
+ - `retest://{analysisId}/runs/{runId}/steps/{stepNumber}/screenshot.png` (Step screenshot)
91
+
92
+ ### Requirement: Resource Content Types
93
+
94
+ The system SHALL return appropriate MIME types for different artifact types.
95
+
96
+ #### Scenario: Markdown resources have correct type
97
+
98
+ - **GIVEN** client reads a `.md` resource
99
+ - **WHEN** response is returned
100
+ - **THEN** mimeType SHALL be `text/markdown`
101
+
102
+ #### Scenario: Screenshot resources have correct type
103
+
104
+ - **GIVEN** client reads a `.png` resource
105
+ - **WHEN** response is returned
106
+ - **THEN** mimeType SHALL be `image/png`
107
+ - **AND** content SHALL be base64 encoded
108
+
109
+ #### Scenario: HTML resources have correct type
110
+
111
+ - **GIVEN** client reads a `.html` resource
112
+ - **WHEN** response is returned
113
+ - **THEN** mimeType SHALL be `text/html`
114
+
115
+ ### Requirement: Resource Listing by Analysis
116
+
117
+ The system SHALL support listing all resources within an analysis.
118
+
119
+ #### Scenario: List all resources for analysis
120
+
121
+ - **GIVEN** an analysis with multiple crawls and runs
122
+ - **WHEN** client calls `resources/list` with `retest://abc123/` prefix
123
+ - **THEN** it SHALL return all resources within that analysis
124
+ - **AND** each resource SHALL include URI, name, and mimeType
125
+
126
+ #### Scenario: List crawl resources
127
+
128
+ - **GIVEN** a crawl with multiple pages
129
+ - **WHEN** client calls `resources/list` with `retest://abc123/crawls/crawl-001/` prefix
130
+ - **THEN** it SHALL return all resources within that crawl
131
+
132
+ ### Requirement: Resource Change Signaling
133
+
134
+ The system SHALL support resource change notifications to surface new artifacts in real-time during long-running operations.
135
+
136
+ #### Scenario: Server emits listChanged when new resource created
137
+
138
+ - **GIVEN** client capability includes `resources.listChanged`
139
+ - **WHEN** a crawl captures a new page artifact
140
+ - **THEN** server SHALL emit `notifications/resources/list_changed`
141
+ - **AND** client can re-fetch `resources/list` to discover new resources
142
+
143
+ #### Scenario: Server emits listChanged during test execution
144
+
145
+ - **GIVEN** client capability includes `resources.listChanged`
146
+ - **WHEN** a test run completes a step and writes evidence
147
+ - **THEN** server SHALL emit `notifications/resources/list_changed`
148
+
149
+ #### Scenario: Fallback when listChanged not supported
150
+
151
+ - **GIVEN** client does not support `resources.listChanged`
152
+ - **WHEN** new resources are created
153
+ - **THEN** server SHALL NOT emit notifications
154
+ - **AND** client must poll `resources/list` to discover new resources
155
+
156
+ ### Requirement: Resource Subscription
157
+
158
+ The system SHALL support resource subscriptions for live updates during operations when client supports it.
159
+
160
+ #### Scenario: Client subscribes to crawl index
161
+
162
+ - **GIVEN** client supports `resources/subscribe`
163
+ - **AND** client subscribes to `retest://abc123/crawls/crawl-001/index.md`
164
+ - **WHEN** crawl adds a new page
165
+ - **THEN** server SHALL emit `notifications/resources/updated` with the resource URI
166
+
167
+ #### Scenario: Client subscribes to analysis status
168
+
169
+ - **GIVEN** client supports `resources/subscribe`
170
+ - **AND** client subscribes to `retest://abc123/index.md`
171
+ - **WHEN** analysis phase changes (crawl -> discover -> generate)
172
+ - **THEN** server SHALL emit `notifications/resources/updated`
173
+
174
+ #### Scenario: Subscription request when unsupported
175
+
176
+ - **GIVEN** client does not support `resources/subscribe`
177
+ - **WHEN** server attempts to notify
178
+ - **THEN** server SHALL skip notification without error
179
+ - **AND** client must poll resources for updates
180
+
181
+ ### Requirement: Workspace Persistence
182
+
183
+ The system SHALL persist all resources to the filesystem for durability.
184
+
185
+ #### Scenario: Resources survive server restart
186
+
187
+ - **GIVEN** an analysis has been created
188
+ - **WHEN** server restarts
189
+ - **THEN** all previously created resources SHALL be accessible
190
+ - **AND** resource URIs SHALL resolve to the same content
191
+
192
+ #### Scenario: Workspace directory is configurable
193
+
194
+ - **GIVEN** environment variable `RETEST_WORKSPACE_DIR` is set to `/data/retests`
195
+ - **WHEN** analysis is created
196
+ - **THEN** workspace SHALL be created under `/data/retests/{analysisId}/`
197
+
198
+ #### Scenario: Default workspace location
199
+
200
+ - **GIVEN** `RETEST_WORKSPACE_DIR` is not set
201
+ - **WHEN** analysis is created
202
+ - **THEN** workspace SHALL be created under `./retest-workspaces/{analysisId}/`
203
+
204
+ ### Requirement: Resource Error Handling
205
+
206
+ The system SHALL return appropriate errors for invalid resource requests.
207
+
208
+ #### Scenario: Unknown analysis returns not found
209
+
210
+ - **GIVEN** client requests `retest://unknown-id/`
211
+ - **WHEN** URI is resolved
212
+ - **THEN** it SHALL return error with code "ResourceNotFound"
213
+
214
+ #### Scenario: Invalid URI format returns error
215
+
216
+ - **GIVEN** client requests resource with invalid URI format
217
+ - **WHEN** URI is parsed
218
+ - **THEN** it SHALL return error with code "InvalidResourceUri"
219
+
220
+ #### Scenario: Missing artifact returns not found
221
+
222
+ - **GIVEN** client requests `retest://abc123/crawls/crawl-001/pages/page-999/screenshot.png`
223
+ - **AND** page-999 does not exist
224
+ - **WHEN** URI is resolved
225
+ - **THEN** it SHALL return error with code "ResourceNotFound"
226
+
227
+ ### Requirement: Hybrid Artifact Access
228
+
229
+ The system SHALL provide both filesystem paths and MCP resource URIs for all artifacts, enabling direct file access alongside MCP resource reads.
230
+
231
+ #### Scenario: Workspace manager returns both path and URI
232
+
233
+ - **GIVEN** a workspace method saves an artifact (analysis, tests, pages, evidence)
234
+ - **WHEN** the save operation completes
235
+ - **THEN** it SHALL return both the absolute filesystem path and the `retest://` URI
236
+ - **AND** the filesystem path SHALL be absolute (not relative)
237
+ - **AND** the path SHALL point to the actual file on disk
238
+
239
+ #### Scenario: File path resolves to same content as resource URI
240
+
241
+ - **GIVEN** an artifact has been saved
242
+ - **WHEN** the file is read directly via filesystem path
243
+ - **AND** the resource is read via MCP `resources/read` with the URI
244
+ - **THEN** both SHALL return identical content
245
+
246
+ #### Scenario: Workspace root path is accessible
247
+
248
+ - **GIVEN** a workspace has been created
249
+ - **WHEN** the workspace manager is queried
250
+ - **THEN** it SHALL provide the absolute path to the workspace root directory
251
+ - **AND** this path SHALL be used as the base for all artifact file paths