diff --git a/docs/RUNNER.md b/docs/RUNNER.md index 45a93e7..5ad8cdc 100644 --- a/docs/RUNNER.md +++ b/docs/RUNNER.md @@ -311,10 +311,10 @@ const result: FullFlowResult = await runner.callFullFlow( **Built-in responder behavior** — controlled by request headers set before the origin phase: -| Header | Effect | -| -------------------- | ------------------------------------------------------------------------------- | -| `x-debugger-status` | HTTP status code for the generated response (default: `200`) | -| `x-debugger-content` | Response body mode: `"body-only"`, `"status-only"`, or full JSON echo (default) | +| Header | Effect | +| -------------------- | -------------------------------------------------------------------------------- | +| `x-debugger-status` | HTTP status code for the generated response (default: `200`) | +| `x-debugger-content` | Response body mode: `"body-only"`, `"status-only"`, or full JSON echo (default) | When `x-debugger-content` is omitted, the built-in responder returns a JSON echo of the request method, headers, body, and URL. Both control headers are stripped before response hooks execute so they do not appear in hook input state. diff --git a/docs/TEST_CONFIG.md b/docs/TEST_CONFIG.md index e71d111..067b13f 100644 --- a/docs/TEST_CONFIG.md +++ b/docs/TEST_CONFIG.md @@ -22,25 +22,25 @@ The config schema is a union of two variants selected by `appType`: ### Top-Level Fields -| JSON Path | Type | Required (Schema) | Default | Description | -| ------------------ | --------- | -------------------------------------- | -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `$schema` | `string` | No | — | URI pointing to the JSON Schema file for IDE autocompletion and validation. | -| `description` | `string` | No | — | Human-readable label for this test scenario. | -| `wasm` | `object` | No | — | WASM binary configuration. Required when running without a programmatic `wasmBuffer`. | -| `wasm.path` | `string` | Yes (if `wasm` present) | — | Path to the compiled `.wasm` binary, relative to the config file or absolute. | -| `wasm.description` | `string` | No | — | Human-readable label for the WASM binary. | -| `appType` | `string` | Yes (schema) / CDN has runtime default | `"proxy-wasm"` | App variant. `"proxy-wasm"` for CDN mode; `"http-wasm"` for HTTP mode. HTTP-WASM has no default. | -| `request` | `object` | **Yes** | — | Incoming HTTP request to simulate. | -| `request.method` | `string` | Yes (schema) / runtime default | `"GET"` | HTTP method (e.g. `"GET"`, `"POST"`). | -| `request.url` | `string` | **Yes** (CDN only) | — | Full URL for the simulated upstream request (e.g. `"https://example.com/api"`). CDN mode only. | -| `request.path` | `string` | **Yes** (HTTP-WASM only) | — | Request path (e.g. `"/api/submit"`). HTTP-WASM mode only. The WASM module acts as the origin server and receives only the path portion of the request. | -| `request.headers` | `object` | Yes (schema) / runtime default | `{}` | Key/value map of request headers. All keys and values must be strings. | -| `request.body` | `string` | Yes (schema) / runtime default | `""` | Request body as a plain string. Use an empty string for requests with no body. | -| `properties` | `object` | **Yes** (schema) / runtime default | `{}` | CDN property key/value pairs passed to the WASM execution context. Values may be any JSON type. | -| `dotenv` | `object` | No | — | Dotenv file loading configuration. | -| `dotenv.enabled` | `boolean` | No | — | Whether to load a `.env` file before execution. | -| `dotenv.path` | `string` | No | — | Path to the `.env` file. If omitted, resolves `.env` relative to the config file directory. | -| `httpPort` | `integer` | No | — | HTTP-WASM only. Pin the subprocess to a specific port (1024–65535) instead of dynamic allocation from the 8100–8199 pool. Throws if the port is busy. | +| JSON Path | Type | Required (Schema) | Default | Description | +| ------------------ | --------- | -------------------------------------- | -------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ | +| `$schema` | `string` | No | — | URI pointing to the JSON Schema file for IDE autocompletion and validation. | +| `description` | `string` | No | — | Human-readable label for this test scenario. | +| `wasm` | `object` | No | — | WASM binary configuration. Required when running without a programmatic `wasmBuffer`. | +| `wasm.path` | `string` | Yes (if `wasm` present) | — | Path to the compiled `.wasm` binary, relative to the config file or absolute. | +| `wasm.description` | `string` | No | — | Human-readable label for the WASM binary. | +| `appType` | `string` | Yes (schema) / CDN has runtime default | `"proxy-wasm"` | App variant. `"proxy-wasm"` for CDN mode; `"http-wasm"` for HTTP mode. HTTP-WASM has no default. | +| `request` | `object` | **Yes** | — | Incoming HTTP request to simulate. | +| `request.method` | `string` | Yes (schema) / runtime default | `"GET"` | HTTP method (e.g. `"GET"`, `"POST"`). | +| `request.url` | `string` | **Yes** (CDN only) | — | Full URL for the simulated upstream request (e.g. `"https://example.com/api"`). CDN mode only. Use `"built-in"` for the local responder. | +| `request.path` | `string` | **Yes** (HTTP-WASM only) | — | Request path (e.g. `"/api/submit"`). HTTP-WASM mode only. The WASM module acts as the origin server and receives only the path portion of the request. | +| `request.headers` | `object` | Yes (schema) / runtime default | `{}` | Key/value map of request headers. All keys and values must be strings. | +| `request.body` | `string` | Yes (schema) / runtime default | `""` | Request body as a plain string. Use an empty string for requests with no body. | +| `properties` | `object` | **Yes** (schema) / runtime default | `{}` | CDN property key/value pairs passed to the WASM execution context. Values may be any JSON type. | +| `dotenv` | `object` | No | — | Dotenv file loading configuration. | +| `dotenv.enabled` | `boolean` | No | — | Whether to load a `.env` file before execution. | +| `dotenv.path` | `string` | No | — | Path to the `.env` file. If omitted, resolves `.env` relative to the config file directory. | +| `httpPort` | `integer` | No | — | HTTP-WASM only. Pin the subprocess to a specific port (1024–65535) instead of dynamic allocation from the 8100–8199 pool. Throws if the port is busy. | ### Required vs. Default Distinction diff --git a/docs/TEST_FRAMEWORK.md b/docs/TEST_FRAMEWORK.md index 563c0c1..300eb22 100644 --- a/docs/TEST_FRAMEWORK.md +++ b/docs/TEST_FRAMEWORK.md @@ -195,13 +195,13 @@ interface RunnerConfig { } ``` -| Field | Type | Description | -| -------------------------------- | ------------------------------- | ------------------------------------------------------------------------- | -| `dotenv.enabled` | `boolean` | Enable dotenv loading | -| `dotenv.path` | `string` | Directory to load dotenv files from; defaults to process CWD when omitted | -| `enforceProductionPropertyRules` | `boolean` | Override production property enforcement for the runner; default `true` | -| `runnerType` | `"http-wasm" \| "proxy-wasm"` | Override automatic WASM type detection | -| `httpPort` | `number` | Pin the HTTP server to a specific port (HTTP WASM only; throws if in use) | +| Field | Type | Description | +| -------------------------------- | ------------------------------ | ------------------------------------------------------------------------- | +| `dotenv.enabled` | `boolean` | Enable dotenv loading | +| `dotenv.path` | `string` | Directory to load dotenv files from; defaults to process CWD when omitted | +| `enforceProductionPropertyRules` | `boolean` | Override production property enforcement for the runner; default `true` | +| `runnerType` | `"http-wasm" \| "proxy-wasm"` | Override automatic WASM type detection | +| `httpPort` | `number` | Pin the HTTP server to a specific port (HTTP WASM only; throws if in use) | ## Functions diff --git a/fastedge-plugin-source/generate-docs.sh b/fastedge-plugin-source/generate-docs.sh index e4d1e29..e8d4914 100755 --- a/fastedge-plugin-source/generate-docs.sh +++ b/fastedge-plugin-source/generate-docs.sh @@ -194,6 +194,11 @@ $existing_doc " fi + # Build prompt with sandwich output constraint: + # The OUTPUT CONSTRAINT appears at both the start and end of the prompt. + # This is critical for large prompts where the model may lose track of + # the instruction to output only raw markdown. Without it, the model + # sometimes produces conversational preamble or asks for permission. local prompt prompt="$(cat <