retestkit 1.4.1 → 1.5.0
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.
- package/README.md +59 -40
- package/dist/config.js +8 -8
- package/dist/config.js.map +1 -1
- package/dist/logger.js +1 -1
- package/dist/logger.js.map +1 -1
- package/dist/prompts/index.d.ts +1 -1
- package/dist/prompts/index.d.ts.map +1 -1
- package/dist/prompts/index.js +21 -21
- package/dist/prompts/index.js.map +1 -1
- package/dist/prompts/templates/mcp/retest-crawl.md +7 -0
- package/{src/prompts/templates/mcp/webtest-discover-flows.md → dist/prompts/templates/mcp/retest-discover-flows.md} +1 -1
- package/{src/prompts/templates/mcp/webtest-discover.md → dist/prompts/templates/mcp/retest-discover.md} +2 -2
- package/dist/prompts/templates/mcp/retest-full-workflow.md +12 -0
- package/{src/prompts/templates/mcp/webtest-generate-tests.md → dist/prompts/templates/mcp/retest-generate-tests.md} +1 -1
- package/{src/prompts/templates/mcp/webtest-run-test.md → dist/prompts/templates/mcp/retest-run-test.md} +1 -1
- package/{src/prompts/templates/mcp/webtest-start.md → dist/prompts/templates/mcp/retest-start.md} +1 -1
- package/{src → dist}/prompts/templates/sampling/system-prefix.md +1 -1
- package/dist/resources/index.js +7 -7
- package/dist/resources/index.js.map +1 -1
- package/dist/schemas/config.js +2 -2
- package/dist/schemas/config.js.map +1 -1
- package/dist/security/index.js +1 -1
- package/dist/security/index.js.map +1 -1
- package/dist/server.js +3 -3
- package/dist/server.js.map +1 -1
- package/dist/test-utils/mock-context.js +22 -22
- package/dist/test-utils/mock-context.js.map +1 -1
- package/dist/tools/index.d.ts +1 -1
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +5 -5
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/retest/crawl.d.ts.map +1 -0
- package/dist/tools/{webtest → retest}/crawl.js +7 -7
- package/dist/tools/retest/crawl.js.map +1 -0
- package/dist/tools/retest/discover-features.d.ts.map +1 -0
- package/dist/tools/{webtest → retest}/discover-features.js +6 -6
- package/dist/tools/retest/discover-features.js.map +1 -0
- package/dist/tools/retest/discover-flows.d.ts.map +1 -0
- package/dist/tools/{webtest → retest}/discover-flows.js +6 -6
- package/dist/tools/retest/discover-flows.js.map +1 -0
- package/dist/tools/retest/generate-tests.d.ts.map +1 -0
- package/dist/tools/{webtest → retest}/generate-tests.js +5 -5
- package/dist/tools/retest/generate-tests.js.map +1 -0
- package/dist/tools/retest/index.d.ts.map +1 -0
- package/dist/tools/retest/index.js.map +1 -0
- package/dist/tools/retest/run-test-case.d.ts.map +1 -0
- package/dist/tools/{webtest → retest}/run-test-case.js +3 -3
- package/dist/tools/retest/run-test-case.js.map +1 -0
- package/dist/tools/retest/schemas.d.ts.map +1 -0
- package/dist/tools/retest/schemas.js.map +1 -0
- package/dist/tools/retest/start-analysis.d.ts.map +1 -0
- package/dist/tools/{webtest → retest}/start-analysis.js +5 -5
- package/dist/tools/retest/start-analysis.js.map +1 -0
- package/dist/workspace/index.js +8 -8
- package/dist/workspace/index.js.map +1 -1
- package/dist/workspace/types.d.ts +2 -2
- package/dist/workspace/types.d.ts.map +1 -1
- package/package.json +6 -2
- package/.claude/commands/openspec/apply.md +0 -23
- package/.claude/commands/openspec/archive.md +0 -27
- package/.claude/commands/openspec/proposal.md +0 -28
- package/.gemini/commands/openspec/apply.toml +0 -21
- package/.gemini/commands/openspec/archive.toml +0 -25
- package/.gemini/commands/openspec/proposal.toml +0 -26
- package/.github/prompts/openspec-apply.prompt.md +0 -22
- package/.github/prompts/openspec-archive.prompt.md +0 -26
- package/.github/prompts/openspec-proposal.prompt.md +0 -27
- package/.github/workflows/release.yml +0 -33
- package/.kilocode/workflows/openspec-apply.md +0 -17
- package/.kilocode/workflows/openspec-archive.md +0 -21
- package/.kilocode/workflows/openspec-proposal.md +0 -22
- package/.mcp.json +0 -23
- package/.opencode/command/openspec-apply.md +0 -25
- package/.opencode/command/openspec-archive.md +0 -28
- package/.opencode/command/openspec-proposal.md +0 -30
- package/.roo/commands/openspec-apply.md +0 -20
- package/.roo/commands/openspec-archive.md +0 -24
- package/.roo/commands/openspec-proposal.md +0 -25
- package/.vscode/mcp.json +0 -23
- package/AGENTS.md +0 -18
- package/CLAUDE.md +0 -18
- package/dist/tools/webtest/crawl.d.ts.map +0 -1
- package/dist/tools/webtest/crawl.js.map +0 -1
- package/dist/tools/webtest/discover-features.d.ts.map +0 -1
- package/dist/tools/webtest/discover-features.js.map +0 -1
- package/dist/tools/webtest/discover-flows.d.ts.map +0 -1
- package/dist/tools/webtest/discover-flows.js.map +0 -1
- package/dist/tools/webtest/generate-tests.d.ts.map +0 -1
- package/dist/tools/webtest/generate-tests.js.map +0 -1
- package/dist/tools/webtest/index.d.ts.map +0 -1
- package/dist/tools/webtest/index.js.map +0 -1
- package/dist/tools/webtest/run-test-case.d.ts.map +0 -1
- package/dist/tools/webtest/run-test-case.js.map +0 -1
- package/dist/tools/webtest/schemas.d.ts.map +0 -1
- package/dist/tools/webtest/schemas.js.map +0 -1
- package/dist/tools/webtest/start-analysis.d.ts.map +0 -1
- package/dist/tools/webtest/start-analysis.js.map +0 -1
- package/openspec/AGENTS.md +0 -456
- package/openspec/changes/archive/2025-12-18-add-hybrid-artifact-paths/proposal.md +0 -33
- package/openspec/changes/archive/2025-12-18-add-hybrid-artifact-paths/specs/webtest-resources/spec.md +0 -27
- package/openspec/changes/archive/2025-12-18-add-hybrid-artifact-paths/specs/webtest-tools/spec.md +0 -304
- package/openspec/changes/archive/2025-12-18-add-hybrid-artifact-paths/tasks.md +0 -43
- package/openspec/changes/archive/2025-12-18-add-mcp-server-foundation/design.md +0 -209
- package/openspec/changes/archive/2025-12-18-add-mcp-server-foundation/proposal.md +0 -41
- package/openspec/changes/archive/2025-12-18-add-mcp-server-foundation/specs/mcp-server-core/spec.md +0 -183
- package/openspec/changes/archive/2025-12-18-add-mcp-server-foundation/tasks.md +0 -112
- package/openspec/changes/archive/2025-12-18-add-webtest-orchestrator/design.md +0 -333
- package/openspec/changes/archive/2025-12-18-add-webtest-orchestrator/proposal.md +0 -66
- package/openspec/changes/archive/2025-12-18-add-webtest-orchestrator/specs/mcp-server-core/spec.md +0 -129
- package/openspec/changes/archive/2025-12-18-add-webtest-orchestrator/specs/webtest-lifecycle/spec.md +0 -138
- package/openspec/changes/archive/2025-12-18-add-webtest-orchestrator/specs/webtest-logging/spec.md +0 -211
- package/openspec/changes/archive/2025-12-18-add-webtest-orchestrator/specs/webtest-prompts/spec.md +0 -157
- package/openspec/changes/archive/2025-12-18-add-webtest-orchestrator/specs/webtest-resources/spec.md +0 -213
- package/openspec/changes/archive/2025-12-18-add-webtest-orchestrator/specs/webtest-sampling/spec.md +0 -257
- package/openspec/changes/archive/2025-12-18-add-webtest-orchestrator/specs/webtest-tools/spec.md +0 -501
- package/openspec/changes/archive/2025-12-18-add-webtest-orchestrator/tasks.md +0 -264
- package/openspec/changes/archive/2025-12-18-allow-analysis-of-incomplete-crawls/proposal.md +0 -24
- package/openspec/changes/archive/2025-12-18-allow-analysis-of-incomplete-crawls/specs/webtest-tools/spec.md +0 -80
- package/openspec/changes/archive/2025-12-18-allow-analysis-of-incomplete-crawls/tasks.md +0 -8
- package/openspec/changes/archive/2025-12-18-fix-crawl-loop-stability/design.md +0 -90
- package/openspec/changes/archive/2025-12-18-fix-crawl-loop-stability/proposal.md +0 -28
- package/openspec/changes/archive/2025-12-18-fix-crawl-loop-stability/specs/webtest-sampling/spec.md +0 -90
- package/openspec/changes/archive/2025-12-18-fix-crawl-loop-stability/tasks.md +0 -33
- package/openspec/changes/archive/2025-12-18-use-markdown-artifacts/design.md +0 -558
- package/openspec/changes/archive/2025-12-18-use-markdown-artifacts/proposal.md +0 -119
- package/openspec/changes/archive/2025-12-18-use-markdown-artifacts/specs/webtest-resources/spec.md +0 -109
- package/openspec/changes/archive/2025-12-18-use-markdown-artifacts/specs/webtest-tools/spec.md +0 -121
- package/openspec/changes/archive/2025-12-18-use-markdown-artifacts/tasks.md +0 -133
- package/openspec/changes/extract-prompts-to-markdown/design.md +0 -86
- package/openspec/changes/extract-prompts-to-markdown/proposal.md +0 -50
- package/openspec/changes/extract-prompts-to-markdown/specs/webtest-prompts/spec.md +0 -74
- package/openspec/changes/extract-prompts-to-markdown/tasks.md +0 -40
- package/openspec/changes/refactor-webtest-naming/design.md +0 -95
- package/openspec/changes/refactor-webtest-naming/proposal.md +0 -66
- package/openspec/changes/refactor-webtest-naming/specs/webtest-prompts/spec.md +0 -79
- package/openspec/changes/refactor-webtest-naming/specs/webtest-resources/spec.md +0 -80
- package/openspec/changes/refactor-webtest-naming/specs/webtest-sampling/spec.md +0 -122
- package/openspec/changes/refactor-webtest-naming/specs/webtest-tools/spec.md +0 -113
- package/openspec/changes/refactor-webtest-naming/tasks.md +0 -119
- package/openspec/changes/rename-package-to-retest/proposal.md +0 -52
- package/openspec/changes/rename-package-to-retest/specs/mcp-server-core/spec.md +0 -53
- package/openspec/changes/rename-package-to-retest/specs/retest-lifecycle/spec.md +0 -68
- package/openspec/changes/rename-package-to-retest/specs/retest-logging/spec.md +0 -35
- package/openspec/changes/rename-package-to-retest/specs/retest-prompts/spec.md +0 -159
- package/openspec/changes/rename-package-to-retest/specs/retest-resources/spec.md +0 -251
- package/openspec/changes/rename-package-to-retest/specs/retest-sampling/spec.md +0 -99
- package/openspec/changes/rename-package-to-retest/specs/retest-tools/spec.md +0 -295
- package/openspec/changes/rename-package-to-retest/tasks.md +0 -71
- package/openspec/project.md +0 -31
- package/openspec/specs/mcp-server-core/spec.md +0 -178
- package/openspec/specs/webtest-lifecycle/spec.md +0 -136
- package/openspec/specs/webtest-logging/spec.md +0 -209
- package/openspec/specs/webtest-prompts/spec.md +0 -155
- package/openspec/specs/webtest-resources/spec.md +0 -248
- package/openspec/specs/webtest-sampling/spec.md +0 -344
- package/openspec/specs/webtest-tools/spec.md +0 -282
- package/release.config.js +0 -9
- package/src/config.test.ts +0 -96
- package/src/config.ts +0 -32
- package/src/elicitation/index.test.ts +0 -399
- package/src/elicitation/index.ts +0 -171
- package/src/elicitation/types.ts +0 -68
- package/src/index.ts +0 -83
- package/src/lifecycle/index.test.ts +0 -260
- package/src/lifecycle/index.ts +0 -101
- package/src/logger.redaction.test.ts +0 -322
- package/src/logger.test.ts +0 -123
- package/src/logger.ts +0 -229
- package/src/playwright-client/index.ts +0 -392
- package/src/playwright-client/types.ts +0 -99
- package/src/progress/index.test.ts +0 -327
- package/src/progress/index.ts +0 -170
- package/src/progress/types.ts +0 -25
- package/src/prompts/index.test.ts +0 -451
- package/src/prompts/index.ts +0 -246
- package/src/prompts/loader.test.ts +0 -100
- package/src/prompts/loader.ts +0 -59
- package/src/prompts/templates/mcp/webtest-crawl.md +0 -7
- package/src/prompts/templates/mcp/webtest-full-workflow.md +0 -12
- package/src/resources/index.ts +0 -250
- package/src/resources/subscriptions.ts +0 -37
- package/src/sampling/index.test.ts +0 -414
- package/src/sampling/index.ts +0 -286
- package/src/sampling/prompts.ts +0 -194
- package/src/sampling/types.ts +0 -60
- package/src/schemas/config.ts +0 -39
- package/src/security/index.test.ts +0 -441
- package/src/security/index.ts +0 -361
- package/src/security/security-scenarios.test.ts +0 -468
- package/src/server.ts +0 -211
- package/src/test-utils/index.ts +0 -6
- package/src/test-utils/mock-context.ts +0 -426
- package/src/test-utils/mock-playwright-client.ts +0 -422
- package/src/tools/index.ts +0 -11
- package/src/tools/webtest/crawl.test.ts +0 -834
- package/src/tools/webtest/crawl.ts +0 -901
- package/src/tools/webtest/discover-features.ts +0 -412
- package/src/tools/webtest/discover-flows.ts +0 -408
- package/src/tools/webtest/generate-tests.test.ts +0 -532
- package/src/tools/webtest/generate-tests.ts +0 -425
- package/src/tools/webtest/index.ts +0 -7
- package/src/tools/webtest/integration.test.ts +0 -536
- package/src/tools/webtest/run-test-case.test.ts +0 -659
- package/src/tools/webtest/run-test-case.ts +0 -508
- package/src/tools/webtest/schemas.ts +0 -201
- package/src/tools/webtest/start-analysis.test.ts +0 -151
- package/src/tools/webtest/start-analysis.ts +0 -158
- package/src/transports/http.ts +0 -19
- package/src/transports/index.ts +0 -30
- package/src/transports/stdio.ts +0 -7
- package/src/types/capabilities.test.ts +0 -193
- package/src/types/capabilities.ts +0 -50
- package/src/types/context.ts +0 -21
- package/src/types/tool.ts +0 -11
- package/src/workspace/index.ts +0 -945
- package/src/workspace/markdown.ts +0 -272
- package/src/workspace/types.ts +0 -186
- package/tests/integration/server.test.ts +0 -89
- package/tests/integration/tools.test.ts +0 -99
- package/tsconfig.json +0 -20
- package/vitest.config.ts +0 -9
- package/vitest.integration.config.ts +0 -10
- /package/{src → dist}/prompts/templates/sampling/crawl-action.md +0 -0
- /package/{src → dist}/prompts/templates/sampling/feature-discovery.md +0 -0
- /package/{src → dist}/prompts/templates/sampling/flow-discovery.md +0 -0
- /package/{src → dist}/prompts/templates/sampling/page-content-wrapper.md +0 -0
- /package/{src → dist}/prompts/templates/sampling/test-evaluation.md +0 -0
- /package/{src → dist}/prompts/templates/sampling/test-generation.md +0 -0
- /package/dist/tools/{webtest → retest}/crawl.d.ts +0 -0
- /package/dist/tools/{webtest → retest}/discover-features.d.ts +0 -0
- /package/dist/tools/{webtest → retest}/discover-flows.d.ts +0 -0
- /package/dist/tools/{webtest → retest}/generate-tests.d.ts +0 -0
- /package/dist/tools/{webtest → retest}/index.d.ts +0 -0
- /package/dist/tools/{webtest → retest}/index.js +0 -0
- /package/dist/tools/{webtest → retest}/run-test-case.d.ts +0 -0
- /package/dist/tools/{webtest → retest}/schemas.d.ts +0 -0
- /package/dist/tools/{webtest → retest}/schemas.js +0 -0
- /package/dist/tools/{webtest → retest}/start-analysis.d.ts +0 -0
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
# webtest-lifecycle Specification
|
|
2
|
-
|
|
3
|
-
## Purpose
|
|
4
|
-
TBD - created by archiving change add-webtest-orchestrator. Update Purpose after archive.
|
|
5
|
-
## Requirements
|
|
6
|
-
### Requirement: MCP Protocol Version Requirements
|
|
7
|
-
|
|
8
|
-
The system SHALL require MCP protocol revision 2025-06-18 or later to ensure elicitation support is available.
|
|
9
|
-
|
|
10
|
-
#### Scenario: Server declares required protocol version
|
|
11
|
-
|
|
12
|
-
- **GIVEN** the server starts
|
|
13
|
-
- **WHEN** it responds to initialize request
|
|
14
|
-
- **THEN** it SHALL declare `protocolVersion: "2025-06-18"` or later
|
|
15
|
-
- **AND** include elicitation in server capabilities
|
|
16
|
-
|
|
17
|
-
#### Scenario: Client with older protocol version
|
|
18
|
-
|
|
19
|
-
- **GIVEN** a client connects with protocol version older than 2025-06-18
|
|
20
|
-
- **WHEN** initialization completes
|
|
21
|
-
- **THEN** the server SHALL record that elicitation is NOT available
|
|
22
|
-
- **AND** log a warning about degraded functionality
|
|
23
|
-
|
|
24
|
-
#### Scenario: Protocol version mismatch handling
|
|
25
|
-
|
|
26
|
-
- **GIVEN** a client requests a protocol version the server cannot satisfy
|
|
27
|
-
- **WHEN** version negotiation occurs
|
|
28
|
-
- **THEN** the server SHALL negotiate to the highest mutually supported version
|
|
29
|
-
- **AND** adjust available features accordingly
|
|
30
|
-
|
|
31
|
-
### Requirement: MCP Lifecycle Management
|
|
32
|
-
|
|
33
|
-
The system SHALL implement proper MCP lifecycle phases (initialize, operate, shutdown) and maintain lifecycle state.
|
|
34
|
-
|
|
35
|
-
#### Scenario: Server transitions through lifecycle phases
|
|
36
|
-
|
|
37
|
-
- **GIVEN** a client connects to the server
|
|
38
|
-
- **WHEN** the connection is established
|
|
39
|
-
- **THEN** the server SHALL be in "initializing" state
|
|
40
|
-
- **AND** after successful initialize handshake, transition to "operating" state
|
|
41
|
-
- **AND** on shutdown signal, transition to "shutdown" state
|
|
42
|
-
|
|
43
|
-
#### Scenario: Server rejects operations before initialization
|
|
44
|
-
|
|
45
|
-
- **GIVEN** the server is in "initializing" state
|
|
46
|
-
- **WHEN** a client sends a tool call request
|
|
47
|
-
- **THEN** the server SHALL return an error indicating initialization not complete
|
|
48
|
-
|
|
49
|
-
#### Scenario: Server rejects new operations during shutdown
|
|
50
|
-
|
|
51
|
-
- **GIVEN** the server is in "shutdown" state
|
|
52
|
-
- **WHEN** a client sends a new tool call request
|
|
53
|
-
- **THEN** the server SHALL return an error indicating server is shutting down
|
|
54
|
-
|
|
55
|
-
### Requirement: Client Capability Negotiation
|
|
56
|
-
|
|
57
|
-
The system SHALL query and record client capabilities during initialization and adapt behavior accordingly.
|
|
58
|
-
|
|
59
|
-
#### Scenario: Server records sampling capability
|
|
60
|
-
|
|
61
|
-
- **GIVEN** a client connects with `capabilities.sampling` present
|
|
62
|
-
- **WHEN** initialization completes
|
|
63
|
-
- **THEN** the server SHALL record that sampling is available
|
|
64
|
-
- **AND** webtest tools SHALL use `sampling/createMessage` for LLM reasoning
|
|
65
|
-
|
|
66
|
-
#### Scenario: Server records elicitation capability
|
|
67
|
-
|
|
68
|
-
- **GIVEN** a client connects with `capabilities.elicitation` present
|
|
69
|
-
- **WHEN** initialization completes
|
|
70
|
-
- **THEN** the server SHALL record that elicitation is available
|
|
71
|
-
- **AND** webtest tools SHALL use `elicitation/create` for user decisions
|
|
72
|
-
|
|
73
|
-
#### Scenario: Server records logging capability
|
|
74
|
-
|
|
75
|
-
- **GIVEN** a client connects with `capabilities.logging` present
|
|
76
|
-
- **WHEN** initialization completes
|
|
77
|
-
- **THEN** the server SHALL record that logging notifications are supported
|
|
78
|
-
- **AND** the logger SHALL emit `notifications/message` to the client
|
|
79
|
-
|
|
80
|
-
#### Scenario: Server records progress capability
|
|
81
|
-
|
|
82
|
-
- **GIVEN** a client connects with MCP progress support
|
|
83
|
-
- **WHEN** initialization completes
|
|
84
|
-
- **THEN** the server SHALL record that progress notifications are supported
|
|
85
|
-
- **AND** long-running tools SHALL emit `notifications/progress`
|
|
86
|
-
|
|
87
|
-
#### Scenario: Server records resources listChanged capability
|
|
88
|
-
|
|
89
|
-
- **GIVEN** a client connects with `capabilities.resources.listChanged` present
|
|
90
|
-
- **WHEN** initialization completes
|
|
91
|
-
- **THEN** the server SHALL record that resource list change notifications are supported
|
|
92
|
-
- **AND** resource creation SHALL emit `notifications/resources/list_changed`
|
|
93
|
-
|
|
94
|
-
#### Scenario: Server records resources subscribe capability
|
|
95
|
-
|
|
96
|
-
- **GIVEN** a client connects with `capabilities.resources.subscribe` present
|
|
97
|
-
- **WHEN** initialization completes
|
|
98
|
-
- **THEN** the server SHALL record that resource subscriptions are supported
|
|
99
|
-
- **AND** resource updates SHALL emit `notifications/resources/updated` to subscribers
|
|
100
|
-
|
|
101
|
-
#### Scenario: Fallback when sampling not supported
|
|
102
|
-
|
|
103
|
-
- **GIVEN** a client connects without `capabilities.sampling`
|
|
104
|
-
- **WHEN** a webtest tool requires LLM reasoning
|
|
105
|
-
- **THEN** the tool SHALL return a prompt resource for manual execution
|
|
106
|
-
- **AND** the tool output SHALL include `needsManualInput: true`
|
|
107
|
-
|
|
108
|
-
#### Scenario: Fallback when elicitation not supported
|
|
109
|
-
|
|
110
|
-
- **GIVEN** a client connects without `capabilities.elicitation`
|
|
111
|
-
- **WHEN** a webtest tool needs user decision
|
|
112
|
-
- **THEN** the tool SHALL include questions in its output
|
|
113
|
-
- **AND** the tool output SHALL include `needsInput: true` with question details
|
|
114
|
-
|
|
115
|
-
### Requirement: Capability Query API
|
|
116
|
-
|
|
117
|
-
The system SHALL provide internal APIs for tools to query client capabilities at runtime.
|
|
118
|
-
|
|
119
|
-
#### Scenario: Tool queries sampling availability
|
|
120
|
-
|
|
121
|
-
- **GIVEN** a tool handler is executing
|
|
122
|
-
- **WHEN** it calls `capabilities.hasSampling()`
|
|
123
|
-
- **THEN** it SHALL receive a boolean indicating sampling support
|
|
124
|
-
|
|
125
|
-
#### Scenario: Tool queries elicitation availability
|
|
126
|
-
|
|
127
|
-
- **GIVEN** a tool handler is executing
|
|
128
|
-
- **WHEN** it calls `capabilities.hasElicitation()`
|
|
129
|
-
- **THEN** it SHALL receive a boolean indicating elicitation support
|
|
130
|
-
|
|
131
|
-
#### Scenario: Tool queries all capabilities
|
|
132
|
-
|
|
133
|
-
- **GIVEN** a tool handler is executing
|
|
134
|
-
- **WHEN** it calls `capabilities.getAll()`
|
|
135
|
-
- **THEN** it SHALL receive an object with all recorded capabilities
|
|
136
|
-
|
|
@@ -1,209 +0,0 @@
|
|
|
1
|
-
# webtest-logging Specification
|
|
2
|
-
|
|
3
|
-
## Purpose
|
|
4
|
-
TBD - created by archiving change add-webtest-orchestrator. Update Purpose after archive.
|
|
5
|
-
## Requirements
|
|
6
|
-
### Requirement: MCP Logging Notifications
|
|
7
|
-
|
|
8
|
-
The system SHALL emit structured logs as MCP logging notifications when the client supports it.
|
|
9
|
-
|
|
10
|
-
#### Scenario: Log emitted as MCP notification
|
|
11
|
-
|
|
12
|
-
- **GIVEN** the client supports MCP logging (`capabilities.logging` present)
|
|
13
|
-
- **WHEN** a log event occurs
|
|
14
|
-
- **THEN** it SHALL emit `notifications/message` with:
|
|
15
|
-
- `level`: one of "debug", "info", "warning", "error"
|
|
16
|
-
- `logger`: "webtest"
|
|
17
|
-
- `data`: structured log payload
|
|
18
|
-
|
|
19
|
-
#### Scenario: Fallback to stderr when logging unsupported
|
|
20
|
-
|
|
21
|
-
- **GIVEN** the client does not support MCP logging
|
|
22
|
-
- **WHEN** a log event occurs
|
|
23
|
-
- **THEN** it SHALL write to stderr as JSON
|
|
24
|
-
- **AND** not attempt MCP notification
|
|
25
|
-
|
|
26
|
-
#### Scenario: Log level is respected
|
|
27
|
-
|
|
28
|
-
- **GIVEN** client log level is set to "warning"
|
|
29
|
-
- **WHEN** an "info" level log is generated
|
|
30
|
-
- **THEN** it SHALL NOT be emitted
|
|
31
|
-
- **AND** "warning" and "error" logs SHALL be emitted
|
|
32
|
-
|
|
33
|
-
### Requirement: Logging Level Control
|
|
34
|
-
|
|
35
|
-
The system SHALL support dynamic log level configuration via MCP and environment.
|
|
36
|
-
|
|
37
|
-
#### Scenario: Log level set via environment
|
|
38
|
-
|
|
39
|
-
- **GIVEN** environment variable `LOG_LEVEL` is set to "debug"
|
|
40
|
-
- **WHEN** the server starts
|
|
41
|
-
- **THEN** all log levels (debug, info, warning, error) SHALL be emitted
|
|
42
|
-
|
|
43
|
-
#### Scenario: Client sets log level via logging/setLevel
|
|
44
|
-
|
|
45
|
-
- **GIVEN** client supports `logging/setLevel`
|
|
46
|
-
- **WHEN** client sends `logging/setLevel` with level "error"
|
|
47
|
-
- **THEN** only "error" level logs SHALL be emitted thereafter
|
|
48
|
-
- **AND** this SHALL override the environment setting
|
|
49
|
-
|
|
50
|
-
#### Scenario: Default log level
|
|
51
|
-
|
|
52
|
-
- **GIVEN** no log level is configured
|
|
53
|
-
- **WHEN** the server starts
|
|
54
|
-
- **THEN** the default log level SHALL be "info"
|
|
55
|
-
|
|
56
|
-
### Requirement: Correlation IDs
|
|
57
|
-
|
|
58
|
-
The system SHALL include correlation IDs in all log messages to enable tracing across operations.
|
|
59
|
-
|
|
60
|
-
#### Scenario: Analysis ID is included in logs
|
|
61
|
-
|
|
62
|
-
- **GIVEN** a tool is executing within an analysis context
|
|
63
|
-
- **WHEN** a log is emitted
|
|
64
|
-
- **THEN** it SHALL include `analysisId` in the log data
|
|
65
|
-
|
|
66
|
-
#### Scenario: Crawl ID is included in crawl logs
|
|
67
|
-
|
|
68
|
-
- **GIVEN** a crawl is in progress
|
|
69
|
-
- **WHEN** a log is emitted during the crawl
|
|
70
|
-
- **THEN** it SHALL include `crawlId` in addition to `analysisId`
|
|
71
|
-
|
|
72
|
-
#### Scenario: Test run ID is included in test logs
|
|
73
|
-
|
|
74
|
-
- **GIVEN** a test case is being executed
|
|
75
|
-
- **WHEN** a log is emitted during test execution
|
|
76
|
-
- **THEN** it SHALL include `testRunId` in addition to `analysisId`
|
|
77
|
-
|
|
78
|
-
#### Scenario: Iteration number is included in loop logs
|
|
79
|
-
|
|
80
|
-
- **GIVEN** a crawl or test loop is executing
|
|
81
|
-
- **WHEN** a log is emitted during an iteration
|
|
82
|
-
- **THEN** it SHALL include `iteration` number
|
|
83
|
-
|
|
84
|
-
#### Scenario: Request ID is included when available
|
|
85
|
-
|
|
86
|
-
- **GIVEN** a tool is handling an MCP request with `_meta.requestId`
|
|
87
|
-
- **WHEN** logs are emitted during that request
|
|
88
|
-
- **THEN** they SHALL include `requestId` for correlation with client logs
|
|
89
|
-
|
|
90
|
-
### Requirement: Structured Log Format
|
|
91
|
-
|
|
92
|
-
The system SHALL emit logs in a consistent structured format.
|
|
93
|
-
|
|
94
|
-
#### Scenario: Log structure is consistent
|
|
95
|
-
|
|
96
|
-
- **GIVEN** any log event occurs
|
|
97
|
-
- **WHEN** it is emitted
|
|
98
|
-
- **THEN** it SHALL include:
|
|
99
|
-
- `timestamp`: ISO 8601 format
|
|
100
|
-
- `level`: log level
|
|
101
|
-
- `message`: human-readable message
|
|
102
|
-
- `context`: object with correlation IDs
|
|
103
|
-
- `data`: optional additional structured data
|
|
104
|
-
|
|
105
|
-
#### Scenario: Playwright MCP tool calls are logged
|
|
106
|
-
|
|
107
|
-
- **GIVEN** a Playwright MCP tool is called
|
|
108
|
-
- **WHEN** the call completes
|
|
109
|
-
- **THEN** it SHALL log:
|
|
110
|
-
- `message`: "Playwright tool executed"
|
|
111
|
-
- `data.tool`: tool name
|
|
112
|
-
- `data.duration`: execution time in ms
|
|
113
|
-
- `data.success`: boolean
|
|
114
|
-
- `data.error`: error message if failed (sensitive data redacted)
|
|
115
|
-
|
|
116
|
-
#### Scenario: Sampling calls are logged
|
|
117
|
-
|
|
118
|
-
- **GIVEN** a sampling request is made
|
|
119
|
-
- **WHEN** the request completes
|
|
120
|
-
- **THEN** it SHALL log:
|
|
121
|
-
- `message`: "Sampling completed"
|
|
122
|
-
- `data.promptTokens`: approximate prompt size
|
|
123
|
-
- `data.responseTokens`: approximate response size
|
|
124
|
-
- `data.duration`: execution time in ms
|
|
125
|
-
- `data.validationPassed`: boolean
|
|
126
|
-
|
|
127
|
-
### Requirement: Sensitive Data Redaction
|
|
128
|
-
|
|
129
|
-
The system SHALL redact sensitive data from logs to prevent credential exposure.
|
|
130
|
-
|
|
131
|
-
#### Scenario: URL query parameters are redacted
|
|
132
|
-
|
|
133
|
-
- **GIVEN** a log includes a URL
|
|
134
|
-
- **WHEN** the URL contains query parameters matching sensitive patterns (token, key, password, secret, auth, session)
|
|
135
|
-
- **THEN** parameter values SHALL be replaced with "[REDACTED]"
|
|
136
|
-
|
|
137
|
-
#### Scenario: Cookie values are redacted
|
|
138
|
-
|
|
139
|
-
- **GIVEN** a log includes cookie data
|
|
140
|
-
- **WHEN** cookies are serialized
|
|
141
|
-
- **THEN** cookie values SHALL be replaced with "[REDACTED]"
|
|
142
|
-
- **AND** only cookie names SHALL be visible
|
|
143
|
-
|
|
144
|
-
#### Scenario: Form input values are redacted
|
|
145
|
-
|
|
146
|
-
- **GIVEN** a log includes form interaction (type action)
|
|
147
|
-
- **WHEN** the input is to a password or sensitive field
|
|
148
|
-
- **THEN** the typed value SHALL be replaced with "[REDACTED]"
|
|
149
|
-
|
|
150
|
-
#### Scenario: HTML content is truncated
|
|
151
|
-
|
|
152
|
-
- **GIVEN** a log includes HTML content
|
|
153
|
-
- **WHEN** the HTML exceeds 500 characters
|
|
154
|
-
- **THEN** it SHALL be truncated with "...[truncated]"
|
|
155
|
-
- **AND** sensitive elements (script, style) SHALL be removed
|
|
156
|
-
|
|
157
|
-
#### Scenario: Known sensitive field patterns are redacted
|
|
158
|
-
|
|
159
|
-
- **GIVEN** a log data object is being serialized
|
|
160
|
-
- **WHEN** it contains keys matching sensitive patterns:
|
|
161
|
-
- password, passwd, pwd
|
|
162
|
-
- token, apiKey, api_key
|
|
163
|
-
- secret, credential
|
|
164
|
-
- authorization, auth
|
|
165
|
-
- session, cookie
|
|
166
|
-
- **THEN** those values SHALL be replaced with "[REDACTED]"
|
|
167
|
-
|
|
168
|
-
### Requirement: Operation Step Logging
|
|
169
|
-
|
|
170
|
-
The system SHALL log detailed step information for debugging and audit.
|
|
171
|
-
|
|
172
|
-
#### Scenario: Crawl step is logged
|
|
173
|
-
|
|
174
|
-
- **GIVEN** a crawl iteration completes
|
|
175
|
-
- **WHEN** step logging occurs
|
|
176
|
-
- **THEN** it SHALL log at "debug" level:
|
|
177
|
-
- Current URL
|
|
178
|
-
- Action taken (tool + args with sensitive data redacted)
|
|
179
|
-
- Result summary
|
|
180
|
-
- Goal progress assessment
|
|
181
|
-
|
|
182
|
-
#### Scenario: Test step is logged
|
|
183
|
-
|
|
184
|
-
- **GIVEN** a test step executes
|
|
185
|
-
- **WHEN** step logging occurs
|
|
186
|
-
- **THEN** it SHALL log at "info" level:
|
|
187
|
-
- Step number and description
|
|
188
|
-
- Actions executed
|
|
189
|
-
- Pass/fail result
|
|
190
|
-
- Evidence URIs
|
|
191
|
-
|
|
192
|
-
#### Scenario: Elicitation event is logged
|
|
193
|
-
|
|
194
|
-
- **GIVEN** elicitation is triggered
|
|
195
|
-
- **WHEN** user response is received
|
|
196
|
-
- **THEN** it SHALL log at "info" level:
|
|
197
|
-
- Elicitation type (cookie, modal, ambiguous, auth)
|
|
198
|
-
- Options presented
|
|
199
|
-
- User selection
|
|
200
|
-
|
|
201
|
-
#### Scenario: Security event is logged
|
|
202
|
-
|
|
203
|
-
- **GIVEN** a security check fails (domain validation, injection detection)
|
|
204
|
-
- **WHEN** the violation is detected
|
|
205
|
-
- **THEN** it SHALL log at "warning" level:
|
|
206
|
-
- Violation type
|
|
207
|
-
- Attempted action (redacted as needed)
|
|
208
|
-
- Remediation taken
|
|
209
|
-
|
|
@@ -1,155 +0,0 @@
|
|
|
1
|
-
# webtest-prompts Specification
|
|
2
|
-
|
|
3
|
-
## Purpose
|
|
4
|
-
TBD - created by archiving change add-webtest-orchestrator. Update Purpose after archive.
|
|
5
|
-
## Requirements
|
|
6
|
-
### Requirement: Prompt Template Registration
|
|
7
|
-
|
|
8
|
-
The system SHALL register prompt templates with the MCP server for client discovery.
|
|
9
|
-
|
|
10
|
-
#### Scenario: Prompts are listed on prompts/list
|
|
11
|
-
|
|
12
|
-
- **GIVEN** a client calls `prompts/list`
|
|
13
|
-
- **WHEN** the response is returned
|
|
14
|
-
- **THEN** it SHALL include prompts:
|
|
15
|
-
- `webtest-start-analysis` (Start web testing analysis)
|
|
16
|
-
- `webtest-crawl` (Crawl to satisfy focus)
|
|
17
|
-
- `webtest-analyze` (Analyze application)
|
|
18
|
-
- `webtest-generate-tests` (Generate test cases)
|
|
19
|
-
- `webtest-run-test` (Run a test case)
|
|
20
|
-
|
|
21
|
-
### Requirement: Start Analysis Prompt
|
|
22
|
-
|
|
23
|
-
The system SHALL provide a prompt template to initiate a web testing analysis.
|
|
24
|
-
|
|
25
|
-
#### Scenario: Start analysis prompt is invoked
|
|
26
|
-
|
|
27
|
-
- **GIVEN** client invokes `prompts/get` with name `webtest-start-analysis`
|
|
28
|
-
- **WHEN** the prompt is returned
|
|
29
|
-
- **THEN** it SHALL include:
|
|
30
|
-
- Description: "Start a new web testing analysis for a URL"
|
|
31
|
-
- Arguments: `url` (required), `focus` (required), `maxSteps` (optional), `maxPages` (optional)
|
|
32
|
-
|
|
33
|
-
#### Scenario: Start analysis prompt generates tool call
|
|
34
|
-
|
|
35
|
-
- **GIVEN** client invokes the prompt with arguments
|
|
36
|
-
- **WHEN** the prompt messages are returned
|
|
37
|
-
- **THEN** it SHALL include a user message instructing to call `webtest_init`
|
|
38
|
-
- **AND** include the provided arguments in the instruction
|
|
39
|
-
|
|
40
|
-
### Requirement: Crawl Prompt
|
|
41
|
-
|
|
42
|
-
The system SHALL provide a prompt template to start or continue a crawl.
|
|
43
|
-
|
|
44
|
-
#### Scenario: Crawl prompt is invoked
|
|
45
|
-
|
|
46
|
-
- **GIVEN** client invokes `prompts/get` with name `webtest-crawl`
|
|
47
|
-
- **WHEN** the prompt is returned
|
|
48
|
-
- **THEN** it SHALL include:
|
|
49
|
-
- Description: "Crawl a web application to explore and achieve a goal"
|
|
50
|
-
- Arguments: `analysisId` (required), `goal` (optional), `strategy` (optional)
|
|
51
|
-
|
|
52
|
-
#### Scenario: Crawl prompt uses analysis goal by default
|
|
53
|
-
|
|
54
|
-
- **GIVEN** client invokes crawl prompt with only `analysisId`
|
|
55
|
-
- **WHEN** the prompt messages are returned
|
|
56
|
-
- **THEN** it SHALL instruct to use the original focus as the crawl goal
|
|
57
|
-
|
|
58
|
-
### Requirement: Analyze Prompt
|
|
59
|
-
|
|
60
|
-
The system SHALL provide a prompt template to analyze crawled data.
|
|
61
|
-
|
|
62
|
-
#### Scenario: Analyze prompt is invoked
|
|
63
|
-
|
|
64
|
-
- **GIVEN** client invokes `prompts/get` with name `webtest-analyze`
|
|
65
|
-
- **WHEN** the prompt is returned
|
|
66
|
-
- **THEN** it SHALL include:
|
|
67
|
-
- Description: "Analyze a crawled web application to understand its structure"
|
|
68
|
-
- Arguments: `analysisId` (required), `crawlId` (required)
|
|
69
|
-
|
|
70
|
-
#### Scenario: Analyze prompt lists available crawls
|
|
71
|
-
|
|
72
|
-
- **GIVEN** client invokes analyze prompt with only `analysisId`
|
|
73
|
-
- **WHEN** the prompt messages are returned
|
|
74
|
-
- **THEN** it SHALL include context about available crawls for that analysis
|
|
75
|
-
|
|
76
|
-
### Requirement: Generate Tests Prompt
|
|
77
|
-
|
|
78
|
-
The system SHALL provide a prompt template to generate test cases.
|
|
79
|
-
|
|
80
|
-
#### Scenario: Generate tests prompt is invoked
|
|
81
|
-
|
|
82
|
-
- **GIVEN** client invokes `prompts/get` with name `webtest-generate-tests`
|
|
83
|
-
- **WHEN** the prompt is returned
|
|
84
|
-
- **THEN** it SHALL include:
|
|
85
|
-
- Description: "Generate test cases from application analysis"
|
|
86
|
-
- Arguments: `analysisId` (required), `count` (optional), `types` (optional)
|
|
87
|
-
|
|
88
|
-
#### Scenario: Generate tests prompt offers strategy options
|
|
89
|
-
|
|
90
|
-
- **GIVEN** client invokes generate tests prompt
|
|
91
|
-
- **WHEN** the prompt messages are returned
|
|
92
|
-
- **THEN** it SHALL mention available test types: "smoke", "negative", "boundary", "integration"
|
|
93
|
-
|
|
94
|
-
### Requirement: Run Test Prompt
|
|
95
|
-
|
|
96
|
-
The system SHALL provide a prompt template to execute a test case.
|
|
97
|
-
|
|
98
|
-
#### Scenario: Run test prompt is invoked
|
|
99
|
-
|
|
100
|
-
- **GIVEN** client invokes `prompts/get` with name `webtest-run-test`
|
|
101
|
-
- **WHEN** the prompt is returned
|
|
102
|
-
- **THEN** it SHALL include:
|
|
103
|
-
- Description: "Execute a test case and capture results"
|
|
104
|
-
- Arguments: `analysisId` (required), `testCaseId` (required)
|
|
105
|
-
|
|
106
|
-
#### Scenario: Run test prompt lists available tests
|
|
107
|
-
|
|
108
|
-
- **GIVEN** client invokes run test prompt with only `analysisId`
|
|
109
|
-
- **WHEN** the prompt messages are returned
|
|
110
|
-
- **THEN** it SHALL include context about available test cases for that analysis
|
|
111
|
-
|
|
112
|
-
### Requirement: Prompt Argument Validation
|
|
113
|
-
|
|
114
|
-
The system SHALL validate prompt arguments and return helpful errors.
|
|
115
|
-
|
|
116
|
-
#### Scenario: Missing required argument returns error
|
|
117
|
-
|
|
118
|
-
- **GIVEN** client invokes `webtest-start-analysis` without `url`
|
|
119
|
-
- **WHEN** validation occurs
|
|
120
|
-
- **THEN** it SHALL return error indicating `url` is required
|
|
121
|
-
|
|
122
|
-
#### Scenario: Invalid analysisId returns error
|
|
123
|
-
|
|
124
|
-
- **GIVEN** client invokes a prompt with non-existent `analysisId`
|
|
125
|
-
- **WHEN** validation occurs
|
|
126
|
-
- **THEN** it SHALL return error indicating analysis not found
|
|
127
|
-
|
|
128
|
-
### Requirement: Prompt Chaining Guidance
|
|
129
|
-
|
|
130
|
-
The system SHALL include guidance in prompt outputs for the recommended workflow sequence.
|
|
131
|
-
|
|
132
|
-
#### Scenario: Start analysis prompt suggests next step
|
|
133
|
-
|
|
134
|
-
- **GIVEN** client uses start analysis prompt
|
|
135
|
-
- **WHEN** the prompt messages are returned
|
|
136
|
-
- **THEN** they SHALL include guidance: "After analysis starts, use webtest-crawl to explore the application"
|
|
137
|
-
|
|
138
|
-
#### Scenario: Crawl prompt suggests next step
|
|
139
|
-
|
|
140
|
-
- **GIVEN** client uses crawl prompt
|
|
141
|
-
- **WHEN** the prompt messages are returned
|
|
142
|
-
- **THEN** they SHALL include guidance: "After crawl completes, use webtest-analyze to understand the application structure"
|
|
143
|
-
|
|
144
|
-
#### Scenario: Analyze prompt suggests next step
|
|
145
|
-
|
|
146
|
-
- **GIVEN** client uses analyze prompt
|
|
147
|
-
- **WHEN** the prompt messages are returned
|
|
148
|
-
- **THEN** they SHALL include guidance: "After analysis, use webtest-generate-tests to create test cases"
|
|
149
|
-
|
|
150
|
-
#### Scenario: Generate tests prompt suggests next step
|
|
151
|
-
|
|
152
|
-
- **GIVEN** client uses generate tests prompt
|
|
153
|
-
- **WHEN** the prompt messages are returned
|
|
154
|
-
- **THEN** they SHALL include guidance: "After test generation, use webtest-run-test to execute individual test cases"
|
|
155
|
-
|