@dotsetlabs/bellwether 0.10.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/CHANGELOG.md +291 -0
- package/LICENSE +21 -0
- package/README.md +739 -0
- package/dist/auth/credentials.d.ts +64 -0
- package/dist/auth/credentials.js +218 -0
- package/dist/auth/index.d.ts +6 -0
- package/dist/auth/index.js +6 -0
- package/dist/auth/keychain.d.ts +64 -0
- package/dist/auth/keychain.js +268 -0
- package/dist/baseline/ab-testing.d.ts +80 -0
- package/dist/baseline/ab-testing.js +236 -0
- package/dist/baseline/ai-compatibility-scorer.d.ts +95 -0
- package/dist/baseline/ai-compatibility-scorer.js +606 -0
- package/dist/baseline/calibration.d.ts +77 -0
- package/dist/baseline/calibration.js +136 -0
- package/dist/baseline/category-matching.d.ts +85 -0
- package/dist/baseline/category-matching.js +289 -0
- package/dist/baseline/change-impact-analyzer.d.ts +98 -0
- package/dist/baseline/change-impact-analyzer.js +592 -0
- package/dist/baseline/comparator.d.ts +64 -0
- package/dist/baseline/comparator.js +916 -0
- package/dist/baseline/confidence.d.ts +55 -0
- package/dist/baseline/confidence.js +122 -0
- package/dist/baseline/converter.d.ts +61 -0
- package/dist/baseline/converter.js +585 -0
- package/dist/baseline/dependency-analyzer.d.ts +89 -0
- package/dist/baseline/dependency-analyzer.js +567 -0
- package/dist/baseline/deprecation-tracker.d.ts +133 -0
- package/dist/baseline/deprecation-tracker.js +322 -0
- package/dist/baseline/diff.d.ts +55 -0
- package/dist/baseline/diff.js +1584 -0
- package/dist/baseline/documentation-scorer.d.ts +205 -0
- package/dist/baseline/documentation-scorer.js +466 -0
- package/dist/baseline/embeddings.d.ts +118 -0
- package/dist/baseline/embeddings.js +251 -0
- package/dist/baseline/error-analyzer.d.ts +198 -0
- package/dist/baseline/error-analyzer.js +721 -0
- package/dist/baseline/evaluation/evaluator.d.ts +42 -0
- package/dist/baseline/evaluation/evaluator.js +323 -0
- package/dist/baseline/evaluation/expanded-dataset.d.ts +45 -0
- package/dist/baseline/evaluation/expanded-dataset.js +1164 -0
- package/dist/baseline/evaluation/golden-dataset.d.ts +58 -0
- package/dist/baseline/evaluation/golden-dataset.js +717 -0
- package/dist/baseline/evaluation/index.d.ts +15 -0
- package/dist/baseline/evaluation/index.js +15 -0
- package/dist/baseline/evaluation/types.d.ts +186 -0
- package/dist/baseline/evaluation/types.js +8 -0
- package/dist/baseline/external-dependency-detector.d.ts +181 -0
- package/dist/baseline/external-dependency-detector.js +524 -0
- package/dist/baseline/golden-output.d.ts +162 -0
- package/dist/baseline/golden-output.js +636 -0
- package/dist/baseline/health-scorer.d.ts +174 -0
- package/dist/baseline/health-scorer.js +451 -0
- package/dist/baseline/incremental-checker.d.ts +97 -0
- package/dist/baseline/incremental-checker.js +174 -0
- package/dist/baseline/index.d.ts +31 -0
- package/dist/baseline/index.js +42 -0
- package/dist/baseline/migration-generator.d.ts +137 -0
- package/dist/baseline/migration-generator.js +554 -0
- package/dist/baseline/migrations.d.ts +60 -0
- package/dist/baseline/migrations.js +197 -0
- package/dist/baseline/performance-tracker.d.ts +214 -0
- package/dist/baseline/performance-tracker.js +577 -0
- package/dist/baseline/pr-comment-generator.d.ts +117 -0
- package/dist/baseline/pr-comment-generator.js +546 -0
- package/dist/baseline/response-fingerprint.d.ts +127 -0
- package/dist/baseline/response-fingerprint.js +728 -0
- package/dist/baseline/response-schema-tracker.d.ts +129 -0
- package/dist/baseline/response-schema-tracker.js +420 -0
- package/dist/baseline/risk-scorer.d.ts +54 -0
- package/dist/baseline/risk-scorer.js +434 -0
- package/dist/baseline/saver.d.ts +89 -0
- package/dist/baseline/saver.js +554 -0
- package/dist/baseline/scenario-generator.d.ts +151 -0
- package/dist/baseline/scenario-generator.js +905 -0
- package/dist/baseline/schema-compare.d.ts +86 -0
- package/dist/baseline/schema-compare.js +557 -0
- package/dist/baseline/schema-evolution.d.ts +189 -0
- package/dist/baseline/schema-evolution.js +467 -0
- package/dist/baseline/semantic.d.ts +203 -0
- package/dist/baseline/semantic.js +908 -0
- package/dist/baseline/synonyms.d.ts +60 -0
- package/dist/baseline/synonyms.js +386 -0
- package/dist/baseline/telemetry.d.ts +165 -0
- package/dist/baseline/telemetry.js +294 -0
- package/dist/baseline/test-pruner.d.ts +120 -0
- package/dist/baseline/test-pruner.js +387 -0
- package/dist/baseline/types.d.ts +449 -0
- package/dist/baseline/types.js +5 -0
- package/dist/baseline/version.d.ts +138 -0
- package/dist/baseline/version.js +206 -0
- package/dist/cache/index.d.ts +5 -0
- package/dist/cache/index.js +5 -0
- package/dist/cache/response-cache.d.ts +151 -0
- package/dist/cache/response-cache.js +287 -0
- package/dist/ci/index.d.ts +60 -0
- package/dist/ci/index.js +342 -0
- package/dist/cli/commands/auth.d.ts +12 -0
- package/dist/cli/commands/auth.js +352 -0
- package/dist/cli/commands/badge.d.ts +3 -0
- package/dist/cli/commands/badge.js +74 -0
- package/dist/cli/commands/baseline-accept.d.ts +15 -0
- package/dist/cli/commands/baseline-accept.js +178 -0
- package/dist/cli/commands/baseline-migrate.d.ts +12 -0
- package/dist/cli/commands/baseline-migrate.js +164 -0
- package/dist/cli/commands/baseline.d.ts +14 -0
- package/dist/cli/commands/baseline.js +449 -0
- package/dist/cli/commands/beta.d.ts +10 -0
- package/dist/cli/commands/beta.js +231 -0
- package/dist/cli/commands/check.d.ts +11 -0
- package/dist/cli/commands/check.js +820 -0
- package/dist/cli/commands/cloud/badge.d.ts +3 -0
- package/dist/cli/commands/cloud/badge.js +74 -0
- package/dist/cli/commands/cloud/diff.d.ts +6 -0
- package/dist/cli/commands/cloud/diff.js +79 -0
- package/dist/cli/commands/cloud/history.d.ts +6 -0
- package/dist/cli/commands/cloud/history.js +102 -0
- package/dist/cli/commands/cloud/link.d.ts +9 -0
- package/dist/cli/commands/cloud/link.js +119 -0
- package/dist/cli/commands/cloud/login.d.ts +7 -0
- package/dist/cli/commands/cloud/login.js +499 -0
- package/dist/cli/commands/cloud/projects.d.ts +6 -0
- package/dist/cli/commands/cloud/projects.js +44 -0
- package/dist/cli/commands/cloud/shared.d.ts +7 -0
- package/dist/cli/commands/cloud/shared.js +42 -0
- package/dist/cli/commands/cloud/teams.d.ts +8 -0
- package/dist/cli/commands/cloud/teams.js +169 -0
- package/dist/cli/commands/cloud/upload.d.ts +8 -0
- package/dist/cli/commands/cloud/upload.js +181 -0
- package/dist/cli/commands/contract.d.ts +11 -0
- package/dist/cli/commands/contract.js +280 -0
- package/dist/cli/commands/discover.d.ts +3 -0
- package/dist/cli/commands/discover.js +82 -0
- package/dist/cli/commands/eval.d.ts +9 -0
- package/dist/cli/commands/eval.js +187 -0
- package/dist/cli/commands/explore.d.ts +11 -0
- package/dist/cli/commands/explore.js +437 -0
- package/dist/cli/commands/feedback.d.ts +9 -0
- package/dist/cli/commands/feedback.js +174 -0
- package/dist/cli/commands/golden.d.ts +12 -0
- package/dist/cli/commands/golden.js +407 -0
- package/dist/cli/commands/history.d.ts +10 -0
- package/dist/cli/commands/history.js +202 -0
- package/dist/cli/commands/init.d.ts +9 -0
- package/dist/cli/commands/init.js +219 -0
- package/dist/cli/commands/interview.d.ts +3 -0
- package/dist/cli/commands/interview.js +903 -0
- package/dist/cli/commands/link.d.ts +10 -0
- package/dist/cli/commands/link.js +169 -0
- package/dist/cli/commands/login.d.ts +7 -0
- package/dist/cli/commands/login.js +499 -0
- package/dist/cli/commands/preset.d.ts +33 -0
- package/dist/cli/commands/preset.js +297 -0
- package/dist/cli/commands/profile.d.ts +33 -0
- package/dist/cli/commands/profile.js +286 -0
- package/dist/cli/commands/registry.d.ts +11 -0
- package/dist/cli/commands/registry.js +146 -0
- package/dist/cli/commands/shared.d.ts +79 -0
- package/dist/cli/commands/shared.js +196 -0
- package/dist/cli/commands/teams.d.ts +8 -0
- package/dist/cli/commands/teams.js +169 -0
- package/dist/cli/commands/test.d.ts +9 -0
- package/dist/cli/commands/test.js +500 -0
- package/dist/cli/commands/upload.d.ts +8 -0
- package/dist/cli/commands/upload.js +223 -0
- package/dist/cli/commands/validate-config.d.ts +6 -0
- package/dist/cli/commands/validate-config.js +35 -0
- package/dist/cli/commands/verify.d.ts +11 -0
- package/dist/cli/commands/verify.js +283 -0
- package/dist/cli/commands/watch.d.ts +12 -0
- package/dist/cli/commands/watch.js +253 -0
- package/dist/cli/index.d.ts +3 -0
- package/dist/cli/index.js +178 -0
- package/dist/cli/interactive.d.ts +47 -0
- package/dist/cli/interactive.js +216 -0
- package/dist/cli/output/terminal-reporter.d.ts +19 -0
- package/dist/cli/output/terminal-reporter.js +104 -0
- package/dist/cli/output.d.ts +226 -0
- package/dist/cli/output.js +438 -0
- package/dist/cli/utils/env.d.ts +5 -0
- package/dist/cli/utils/env.js +14 -0
- package/dist/cli/utils/progress.d.ts +59 -0
- package/dist/cli/utils/progress.js +206 -0
- package/dist/cli/utils/server-context.d.ts +10 -0
- package/dist/cli/utils/server-context.js +36 -0
- package/dist/cloud/auth.d.ts +144 -0
- package/dist/cloud/auth.js +374 -0
- package/dist/cloud/client.d.ts +24 -0
- package/dist/cloud/client.js +65 -0
- package/dist/cloud/http-client.d.ts +38 -0
- package/dist/cloud/http-client.js +215 -0
- package/dist/cloud/index.d.ts +23 -0
- package/dist/cloud/index.js +25 -0
- package/dist/cloud/mock-client.d.ts +107 -0
- package/dist/cloud/mock-client.js +545 -0
- package/dist/cloud/types.d.ts +515 -0
- package/dist/cloud/types.js +15 -0
- package/dist/config/defaults.d.ts +160 -0
- package/dist/config/defaults.js +169 -0
- package/dist/config/loader.d.ts +24 -0
- package/dist/config/loader.js +122 -0
- package/dist/config/template.d.ts +42 -0
- package/dist/config/template.js +647 -0
- package/dist/config/validator.d.ts +2112 -0
- package/dist/config/validator.js +658 -0
- package/dist/constants/cloud.d.ts +107 -0
- package/dist/constants/cloud.js +110 -0
- package/dist/constants/core.d.ts +521 -0
- package/dist/constants/core.js +556 -0
- package/dist/constants/testing.d.ts +1283 -0
- package/dist/constants/testing.js +1568 -0
- package/dist/constants.d.ts +10 -0
- package/dist/constants.js +10 -0
- package/dist/contract/index.d.ts +6 -0
- package/dist/contract/index.js +5 -0
- package/dist/contract/validator.d.ts +177 -0
- package/dist/contract/validator.js +574 -0
- package/dist/cost/index.d.ts +6 -0
- package/dist/cost/index.js +5 -0
- package/dist/cost/tracker.d.ts +134 -0
- package/dist/cost/tracker.js +313 -0
- package/dist/discovery/discovery.d.ts +16 -0
- package/dist/discovery/discovery.js +173 -0
- package/dist/discovery/types.d.ts +51 -0
- package/dist/discovery/types.js +2 -0
- package/dist/docs/agents.d.ts +3 -0
- package/dist/docs/agents.js +995 -0
- package/dist/docs/contract.d.ts +51 -0
- package/dist/docs/contract.js +1681 -0
- package/dist/docs/generator.d.ts +4 -0
- package/dist/docs/generator.js +4 -0
- package/dist/docs/html-reporter.d.ts +9 -0
- package/dist/docs/html-reporter.js +757 -0
- package/dist/docs/index.d.ts +10 -0
- package/dist/docs/index.js +11 -0
- package/dist/docs/junit-reporter.d.ts +18 -0
- package/dist/docs/junit-reporter.js +210 -0
- package/dist/docs/report.d.ts +14 -0
- package/dist/docs/report.js +44 -0
- package/dist/docs/sarif-reporter.d.ts +19 -0
- package/dist/docs/sarif-reporter.js +335 -0
- package/dist/docs/shared.d.ts +35 -0
- package/dist/docs/shared.js +162 -0
- package/dist/docs/templates.d.ts +12 -0
- package/dist/docs/templates.js +76 -0
- package/dist/errors/index.d.ts +6 -0
- package/dist/errors/index.js +6 -0
- package/dist/errors/retry.d.ts +92 -0
- package/dist/errors/retry.js +323 -0
- package/dist/errors/types.d.ts +321 -0
- package/dist/errors/types.js +584 -0
- package/dist/index.d.ts +32 -0
- package/dist/index.js +32 -0
- package/dist/interview/dependency-resolver.d.ts +11 -0
- package/dist/interview/dependency-resolver.js +32 -0
- package/dist/interview/interviewer.d.ts +232 -0
- package/dist/interview/interviewer.js +1939 -0
- package/dist/interview/mock-response-generator.d.ts +7 -0
- package/dist/interview/mock-response-generator.js +102 -0
- package/dist/interview/orchestrator.d.ts +237 -0
- package/dist/interview/orchestrator.js +1296 -0
- package/dist/interview/rate-limiter.d.ts +15 -0
- package/dist/interview/rate-limiter.js +55 -0
- package/dist/interview/response-validator.d.ts +10 -0
- package/dist/interview/response-validator.js +132 -0
- package/dist/interview/schema-inferrer.d.ts +8 -0
- package/dist/interview/schema-inferrer.js +71 -0
- package/dist/interview/schema-test-generator.d.ts +71 -0
- package/dist/interview/schema-test-generator.js +834 -0
- package/dist/interview/smart-value-generator.d.ts +155 -0
- package/dist/interview/smart-value-generator.js +554 -0
- package/dist/interview/stateful-test-runner.d.ts +19 -0
- package/dist/interview/stateful-test-runner.js +106 -0
- package/dist/interview/types.d.ts +561 -0
- package/dist/interview/types.js +2 -0
- package/dist/llm/anthropic.d.ts +41 -0
- package/dist/llm/anthropic.js +355 -0
- package/dist/llm/client.d.ts +123 -0
- package/dist/llm/client.js +42 -0
- package/dist/llm/factory.d.ts +38 -0
- package/dist/llm/factory.js +145 -0
- package/dist/llm/fallback.d.ts +140 -0
- package/dist/llm/fallback.js +379 -0
- package/dist/llm/index.d.ts +18 -0
- package/dist/llm/index.js +15 -0
- package/dist/llm/ollama.d.ts +37 -0
- package/dist/llm/ollama.js +330 -0
- package/dist/llm/openai.d.ts +25 -0
- package/dist/llm/openai.js +320 -0
- package/dist/llm/token-budget.d.ts +161 -0
- package/dist/llm/token-budget.js +395 -0
- package/dist/logging/logger.d.ts +70 -0
- package/dist/logging/logger.js +130 -0
- package/dist/metrics/collector.d.ts +106 -0
- package/dist/metrics/collector.js +547 -0
- package/dist/metrics/index.d.ts +7 -0
- package/dist/metrics/index.js +7 -0
- package/dist/metrics/prometheus.d.ts +20 -0
- package/dist/metrics/prometheus.js +241 -0
- package/dist/metrics/types.d.ts +209 -0
- package/dist/metrics/types.js +5 -0
- package/dist/persona/builtins.d.ts +54 -0
- package/dist/persona/builtins.js +219 -0
- package/dist/persona/index.d.ts +8 -0
- package/dist/persona/index.js +8 -0
- package/dist/persona/loader.d.ts +30 -0
- package/dist/persona/loader.js +190 -0
- package/dist/persona/types.d.ts +144 -0
- package/dist/persona/types.js +5 -0
- package/dist/persona/validation.d.ts +94 -0
- package/dist/persona/validation.js +332 -0
- package/dist/prompts/index.d.ts +5 -0
- package/dist/prompts/index.js +5 -0
- package/dist/prompts/templates.d.ts +180 -0
- package/dist/prompts/templates.js +431 -0
- package/dist/registry/client.d.ts +49 -0
- package/dist/registry/client.js +191 -0
- package/dist/registry/index.d.ts +7 -0
- package/dist/registry/index.js +6 -0
- package/dist/registry/types.d.ts +140 -0
- package/dist/registry/types.js +6 -0
- package/dist/scenarios/evaluator.d.ts +43 -0
- package/dist/scenarios/evaluator.js +206 -0
- package/dist/scenarios/index.d.ts +10 -0
- package/dist/scenarios/index.js +9 -0
- package/dist/scenarios/loader.d.ts +20 -0
- package/dist/scenarios/loader.js +285 -0
- package/dist/scenarios/types.d.ts +153 -0
- package/dist/scenarios/types.js +8 -0
- package/dist/security/index.d.ts +17 -0
- package/dist/security/index.js +18 -0
- package/dist/security/payloads.d.ts +61 -0
- package/dist/security/payloads.js +268 -0
- package/dist/security/security-tester.d.ts +42 -0
- package/dist/security/security-tester.js +582 -0
- package/dist/security/types.d.ts +166 -0
- package/dist/security/types.js +8 -0
- package/dist/transport/base-transport.d.ts +59 -0
- package/dist/transport/base-transport.js +38 -0
- package/dist/transport/http-transport.d.ts +67 -0
- package/dist/transport/http-transport.js +238 -0
- package/dist/transport/mcp-client.d.ts +141 -0
- package/dist/transport/mcp-client.js +496 -0
- package/dist/transport/sse-transport.d.ts +88 -0
- package/dist/transport/sse-transport.js +316 -0
- package/dist/transport/stdio-transport.d.ts +43 -0
- package/dist/transport/stdio-transport.js +238 -0
- package/dist/transport/types.d.ts +125 -0
- package/dist/transport/types.js +16 -0
- package/dist/utils/concurrency.d.ts +123 -0
- package/dist/utils/concurrency.js +213 -0
- package/dist/utils/formatters.d.ts +16 -0
- package/dist/utils/formatters.js +37 -0
- package/dist/utils/index.d.ts +8 -0
- package/dist/utils/index.js +8 -0
- package/dist/utils/jsonpath.d.ts +87 -0
- package/dist/utils/jsonpath.js +326 -0
- package/dist/utils/markdown.d.ts +113 -0
- package/dist/utils/markdown.js +265 -0
- package/dist/utils/network.d.ts +14 -0
- package/dist/utils/network.js +17 -0
- package/dist/utils/sanitize.d.ts +92 -0
- package/dist/utils/sanitize.js +191 -0
- package/dist/utils/semantic.d.ts +194 -0
- package/dist/utils/semantic.js +1051 -0
- package/dist/utils/smart-truncate.d.ts +94 -0
- package/dist/utils/smart-truncate.js +361 -0
- package/dist/utils/timeout.d.ts +153 -0
- package/dist/utils/timeout.js +205 -0
- package/dist/utils/yaml-parser.d.ts +58 -0
- package/dist/utils/yaml-parser.js +86 -0
- package/dist/validation/index.d.ts +32 -0
- package/dist/validation/index.js +32 -0
- package/dist/validation/semantic-test-generator.d.ts +50 -0
- package/dist/validation/semantic-test-generator.js +176 -0
- package/dist/validation/semantic-types.d.ts +66 -0
- package/dist/validation/semantic-types.js +94 -0
- package/dist/validation/semantic-validator.d.ts +38 -0
- package/dist/validation/semantic-validator.js +340 -0
- package/dist/verification/index.d.ts +6 -0
- package/dist/verification/index.js +5 -0
- package/dist/verification/types.d.ts +133 -0
- package/dist/verification/types.js +5 -0
- package/dist/verification/verifier.d.ts +30 -0
- package/dist/verification/verifier.js +309 -0
- package/dist/version.d.ts +19 -0
- package/dist/version.js +48 -0
- package/dist/workflow/auto-generator.d.ts +27 -0
- package/dist/workflow/auto-generator.js +513 -0
- package/dist/workflow/discovery.d.ts +40 -0
- package/dist/workflow/discovery.js +195 -0
- package/dist/workflow/executor.d.ts +82 -0
- package/dist/workflow/executor.js +611 -0
- package/dist/workflow/index.d.ts +10 -0
- package/dist/workflow/index.js +10 -0
- package/dist/workflow/loader.d.ts +24 -0
- package/dist/workflow/loader.js +194 -0
- package/dist/workflow/state-tracker.d.ts +98 -0
- package/dist/workflow/state-tracker.js +424 -0
- package/dist/workflow/types.d.ts +337 -0
- package/dist/workflow/types.js +5 -0
- package/package.json +94 -0
- package/schemas/bellwether-check.schema.json +651 -0
|
@@ -0,0 +1,219 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Built-in persona definitions.
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* Technical Writer persona - balanced documentation focus.
|
|
6
|
+
*/
|
|
7
|
+
export const technicalWriterPersona = {
|
|
8
|
+
id: 'technical_writer',
|
|
9
|
+
name: 'Technical Writer',
|
|
10
|
+
description: 'Creates comprehensive API documentation with realistic examples',
|
|
11
|
+
systemPrompt: `You are a technical documentation specialist creating API reference documentation.
|
|
12
|
+
Your goal is to generate helpful, realistic examples that developers can use as templates.
|
|
13
|
+
Focus on demonstrating the full range of tool capabilities with practical use cases.
|
|
14
|
+
Be thorough but concise. Prioritize clarity and usefulness over edge cases.`,
|
|
15
|
+
questionBias: {
|
|
16
|
+
happyPath: 0.5,
|
|
17
|
+
edgeCase: 0.2,
|
|
18
|
+
errorHandling: 0.2,
|
|
19
|
+
boundary: 0.1,
|
|
20
|
+
},
|
|
21
|
+
categories: ['happy_path', 'edge_case', 'error_handling'],
|
|
22
|
+
builtin: true,
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Security Tester persona - vulnerability-focused.
|
|
26
|
+
*
|
|
27
|
+
* Note: Prompts are designed to avoid triggering LLM safety filters while still
|
|
28
|
+
* enabling meaningful security testing. We describe test categories rather than
|
|
29
|
+
* including specific payloads, letting the LLM generate appropriate test inputs.
|
|
30
|
+
*/
|
|
31
|
+
export const securityTesterPersona = {
|
|
32
|
+
id: 'security_tester',
|
|
33
|
+
name: 'Security Tester',
|
|
34
|
+
description: 'Probes for security vulnerabilities and unsafe behaviors',
|
|
35
|
+
systemPrompt: `You are a security documentation specialist creating API security test documentation.
|
|
36
|
+
Your goal is to generate test cases that verify proper input validation and error handling.
|
|
37
|
+
|
|
38
|
+
Generate test cases for these security validation categories:
|
|
39
|
+
- Path handling: Test how the API handles relative paths, parent directory references, and encoded path characters
|
|
40
|
+
- Input sanitization: Test how the API handles special characters that could be interpreted as code or commands
|
|
41
|
+
- URL validation: Test how the API validates and restricts URL inputs
|
|
42
|
+
- Numeric boundaries: Test extreme values, negative numbers, and special numeric values
|
|
43
|
+
- Empty and null handling: Test missing, empty, and null inputs
|
|
44
|
+
|
|
45
|
+
For each test:
|
|
46
|
+
1. Use realistic but clearly test-oriented inputs (e.g., paths like "/test/../safe" not actual system paths)
|
|
47
|
+
2. Document what security property is being validated
|
|
48
|
+
3. Note whether the API properly rejects or sanitizes potentially dangerous inputs
|
|
49
|
+
4. Observe error message content for information disclosure
|
|
50
|
+
|
|
51
|
+
Focus on testing INPUT VALIDATION behaviors, not exploitation.
|
|
52
|
+
Your test cases help API developers understand their security posture.`,
|
|
53
|
+
questionBias: {
|
|
54
|
+
happyPath: 0.1,
|
|
55
|
+
edgeCase: 0.2,
|
|
56
|
+
errorHandling: 0.2,
|
|
57
|
+
boundary: 0.2,
|
|
58
|
+
security: 0.3,
|
|
59
|
+
},
|
|
60
|
+
categories: ['security', 'boundary', 'error_handling'],
|
|
61
|
+
additionalContext: `Security test input patterns (use variations appropriate to the tool):
|
|
62
|
+
|
|
63
|
+
Path validation tests:
|
|
64
|
+
- Relative paths with parent references (test path traversal handling)
|
|
65
|
+
- URL-encoded path characters (test encoding handling)
|
|
66
|
+
- Paths outside expected directories (test directory restrictions)
|
|
67
|
+
|
|
68
|
+
String validation tests:
|
|
69
|
+
- Strings with SQL-like syntax (test SQL injection prevention)
|
|
70
|
+
- Strings with markup syntax (test XSS prevention)
|
|
71
|
+
- Strings with shell metacharacters (test command injection prevention)
|
|
72
|
+
|
|
73
|
+
URL validation tests:
|
|
74
|
+
- Internal/private network addresses (test SSRF prevention)
|
|
75
|
+
- Non-HTTP protocols (test protocol validation)
|
|
76
|
+
- Localhost and loopback variations (test internal access restrictions)
|
|
77
|
+
|
|
78
|
+
Numeric validation tests:
|
|
79
|
+
- Zero, negative numbers, and boundary values
|
|
80
|
+
- Very large numbers and overflow values
|
|
81
|
+
- Non-numeric strings where numbers expected
|
|
82
|
+
|
|
83
|
+
Generate realistic test inputs that verify these security controls work correctly.`,
|
|
84
|
+
builtin: true,
|
|
85
|
+
};
|
|
86
|
+
/**
|
|
87
|
+
* QA Engineer persona - edge case and error focus.
|
|
88
|
+
*/
|
|
89
|
+
export const qaEngineerPersona = {
|
|
90
|
+
id: 'qa_engineer',
|
|
91
|
+
name: 'QA Engineer',
|
|
92
|
+
description: 'Tests edge cases, error conditions, and unexpected inputs',
|
|
93
|
+
systemPrompt: `You are a quality assurance engineer testing an API for robustness.
|
|
94
|
+
Your goal is to find edge cases, error conditions, and unexpected behaviors.
|
|
95
|
+
Focus on:
|
|
96
|
+
- Boundary values (min, max, just over/under limits)
|
|
97
|
+
- Type coercion issues (strings vs numbers, null handling)
|
|
98
|
+
- Empty and missing values
|
|
99
|
+
- Unicode and special characters
|
|
100
|
+
- Concurrent/timing issues
|
|
101
|
+
- State corruption scenarios
|
|
102
|
+
|
|
103
|
+
Generate test cases that stress the tool's error handling and validation.
|
|
104
|
+
Document any crashes, hangs, or unexpected error messages.`,
|
|
105
|
+
questionBias: {
|
|
106
|
+
happyPath: 0.1,
|
|
107
|
+
edgeCase: 0.35,
|
|
108
|
+
errorHandling: 0.35,
|
|
109
|
+
boundary: 0.2,
|
|
110
|
+
},
|
|
111
|
+
categories: ['edge_case', 'error_handling', 'boundary'],
|
|
112
|
+
additionalContext: `Edge cases to test:
|
|
113
|
+
- Empty strings, whitespace-only strings
|
|
114
|
+
- Very long strings (1000+ chars)
|
|
115
|
+
- Unicode: emoji, RTL text, zero-width chars
|
|
116
|
+
- Numbers: 0, -0, negative, floats for ints
|
|
117
|
+
- Arrays: empty, single item, thousands of items
|
|
118
|
+
- Objects: empty, deeply nested, circular (if possible)`,
|
|
119
|
+
builtin: true,
|
|
120
|
+
};
|
|
121
|
+
/**
|
|
122
|
+
* Novice User persona - usability and error message focus.
|
|
123
|
+
*/
|
|
124
|
+
export const noviceUserPersona = {
|
|
125
|
+
id: 'novice_user',
|
|
126
|
+
name: 'Novice User',
|
|
127
|
+
description: 'Tests from the perspective of a new user making common mistakes',
|
|
128
|
+
systemPrompt: `You are a new developer using this API for the first time.
|
|
129
|
+
Your goal is to test how the API handles common mistakes and misunderstandings.
|
|
130
|
+
Focus on:
|
|
131
|
+
- Missing required parameters
|
|
132
|
+
- Wrong parameter types (string instead of number, etc.)
|
|
133
|
+
- Misspelled parameter names
|
|
134
|
+
- Incorrect formats (dates, URLs, emails)
|
|
135
|
+
- Reasonable but wrong assumptions
|
|
136
|
+
|
|
137
|
+
Evaluate the quality of error messages:
|
|
138
|
+
- Are they clear and actionable?
|
|
139
|
+
- Do they help the user fix the problem?
|
|
140
|
+
- Do they expose implementation details?
|
|
141
|
+
|
|
142
|
+
Generate test cases that a confused beginner might try.`,
|
|
143
|
+
questionBias: {
|
|
144
|
+
happyPath: 0.2,
|
|
145
|
+
edgeCase: 0.2,
|
|
146
|
+
errorHandling: 0.5,
|
|
147
|
+
boundary: 0.1,
|
|
148
|
+
},
|
|
149
|
+
categories: ['error_handling', 'happy_path', 'edge_case'],
|
|
150
|
+
additionalContext: `Common novice mistakes:
|
|
151
|
+
- Omitting required parameters
|
|
152
|
+
- Using wrong case (userId vs userid)
|
|
153
|
+
- Wrong types (passing "123" instead of 123)
|
|
154
|
+
- Incomplete data (partial objects)
|
|
155
|
+
- Obvious typos in enum values
|
|
156
|
+
- Mixing up similar parameters`,
|
|
157
|
+
builtin: true,
|
|
158
|
+
};
|
|
159
|
+
/**
|
|
160
|
+
* Map of built-in persona IDs to definitions.
|
|
161
|
+
*/
|
|
162
|
+
export const BUILTIN_PERSONAS = {
|
|
163
|
+
technical_writer: technicalWriterPersona,
|
|
164
|
+
security_tester: securityTesterPersona,
|
|
165
|
+
qa_engineer: qaEngineerPersona,
|
|
166
|
+
novice_user: noviceUserPersona,
|
|
167
|
+
};
|
|
168
|
+
/**
|
|
169
|
+
* Get a built-in persona by ID.
|
|
170
|
+
*/
|
|
171
|
+
export function getBuiltinPersona(id) {
|
|
172
|
+
const persona = BUILTIN_PERSONAS[id];
|
|
173
|
+
if (!persona) {
|
|
174
|
+
throw new Error(`Unknown built-in persona: ${id}`);
|
|
175
|
+
}
|
|
176
|
+
return persona;
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Check if a persona ID is a built-in.
|
|
180
|
+
*/
|
|
181
|
+
export function isBuiltinPersona(id) {
|
|
182
|
+
return id in BUILTIN_PERSONAS;
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Get all built-in persona IDs.
|
|
186
|
+
*/
|
|
187
|
+
export function getBuiltinPersonaIds() {
|
|
188
|
+
return Object.keys(BUILTIN_PERSONAS);
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Default persona for interviews.
|
|
192
|
+
*/
|
|
193
|
+
export const DEFAULT_PERSONA = technicalWriterPersona;
|
|
194
|
+
/**
|
|
195
|
+
* Parse persona list from string array of persona IDs.
|
|
196
|
+
* Returns the DEFAULT_PERSONA if the list is empty or contains no valid personas.
|
|
197
|
+
*
|
|
198
|
+
* @param personaList - Array of persona ID strings
|
|
199
|
+
* @param warnOnUnknown - Optional callback for unknown persona warnings
|
|
200
|
+
* @returns Array of resolved Persona objects
|
|
201
|
+
*/
|
|
202
|
+
export function parsePersonas(personaList, warnOnUnknown) {
|
|
203
|
+
if (personaList.length === 0) {
|
|
204
|
+
return [DEFAULT_PERSONA];
|
|
205
|
+
}
|
|
206
|
+
const personas = [];
|
|
207
|
+
const validNames = Object.keys(BUILTIN_PERSONAS);
|
|
208
|
+
for (const name of personaList) {
|
|
209
|
+
const persona = BUILTIN_PERSONAS[name];
|
|
210
|
+
if (persona) {
|
|
211
|
+
personas.push(persona);
|
|
212
|
+
}
|
|
213
|
+
else if (warnOnUnknown) {
|
|
214
|
+
warnOnUnknown(name, validNames);
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
return personas.length > 0 ? personas : [DEFAULT_PERSONA];
|
|
218
|
+
}
|
|
219
|
+
//# sourceMappingURL=builtins.js.map
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Persona loader - resolves persona IDs and loads custom personas from YAML.
|
|
3
|
+
*/
|
|
4
|
+
import type { Persona } from './types.js';
|
|
5
|
+
/**
|
|
6
|
+
* Options for loading personas.
|
|
7
|
+
*/
|
|
8
|
+
export interface LoadPersonaOptions {
|
|
9
|
+
/** Persona ID(s) - can be built-in IDs or paths to YAML files */
|
|
10
|
+
personas?: string | string[];
|
|
11
|
+
/** Explicit path to a persona YAML file */
|
|
12
|
+
personaFile?: string;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Load personas from IDs or file paths.
|
|
16
|
+
*/
|
|
17
|
+
export declare function loadPersonas(options?: LoadPersonaOptions): Persona[];
|
|
18
|
+
/**
|
|
19
|
+
* Resolve a persona from ID or file path.
|
|
20
|
+
*/
|
|
21
|
+
export declare function resolvePersona(personaSpec: string): Persona;
|
|
22
|
+
/**
|
|
23
|
+
* Load a persona from a YAML file.
|
|
24
|
+
*/
|
|
25
|
+
export declare function loadPersonaFromFile(path: string): Persona;
|
|
26
|
+
/**
|
|
27
|
+
* Generate a sample custom persona YAML.
|
|
28
|
+
*/
|
|
29
|
+
export declare function generateSamplePersonaYaml(): string;
|
|
30
|
+
//# sourceMappingURL=loader.d.ts.map
|
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Persona loader - resolves persona IDs and loads custom personas from YAML.
|
|
3
|
+
*/
|
|
4
|
+
import { readFileSync, existsSync } from 'fs';
|
|
5
|
+
import { parseYamlSecure } from '../utils/yaml-parser.js';
|
|
6
|
+
import { BUILTIN_PERSONAS, isBuiltinPersona, DEFAULT_PERSONA } from './builtins.js';
|
|
7
|
+
import { validatePersona, formatValidationErrors, normalizeBiasWeights } from './validation.js';
|
|
8
|
+
import { getLogger } from '../logging/logger.js';
|
|
9
|
+
import { MATH_FACTORS } from '../constants.js';
|
|
10
|
+
/**
|
|
11
|
+
* Load personas from IDs or file paths.
|
|
12
|
+
*/
|
|
13
|
+
export function loadPersonas(options = {}) {
|
|
14
|
+
const result = [];
|
|
15
|
+
// Handle explicit persona file
|
|
16
|
+
if (options.personaFile) {
|
|
17
|
+
const persona = loadPersonaFromFile(options.personaFile);
|
|
18
|
+
result.push(persona);
|
|
19
|
+
}
|
|
20
|
+
// Handle persona IDs/paths
|
|
21
|
+
if (options.personas) {
|
|
22
|
+
const personaList = Array.isArray(options.personas)
|
|
23
|
+
? options.personas
|
|
24
|
+
: options.personas.split(',').map(s => s.trim());
|
|
25
|
+
for (const personaSpec of personaList) {
|
|
26
|
+
const persona = resolvePersona(personaSpec);
|
|
27
|
+
// Avoid duplicates
|
|
28
|
+
if (!result.some(p => p.id === persona.id)) {
|
|
29
|
+
result.push(persona);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
// Default to technical_writer if nothing specified
|
|
34
|
+
if (result.length === 0) {
|
|
35
|
+
result.push(DEFAULT_PERSONA);
|
|
36
|
+
}
|
|
37
|
+
return result;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* Resolve a persona from ID or file path.
|
|
41
|
+
*/
|
|
42
|
+
export function resolvePersona(personaSpec) {
|
|
43
|
+
// Check if it's a built-in persona ID
|
|
44
|
+
if (isBuiltinPersona(personaSpec)) {
|
|
45
|
+
return BUILTIN_PERSONAS[personaSpec];
|
|
46
|
+
}
|
|
47
|
+
// Check common aliases
|
|
48
|
+
const aliases = {
|
|
49
|
+
'writer': 'technical_writer',
|
|
50
|
+
'security': 'security_tester',
|
|
51
|
+
'qa': 'qa_engineer',
|
|
52
|
+
'novice': 'novice_user',
|
|
53
|
+
'beginner': 'novice_user',
|
|
54
|
+
};
|
|
55
|
+
if (personaSpec in aliases) {
|
|
56
|
+
const aliasedId = aliases[personaSpec];
|
|
57
|
+
if (isBuiltinPersona(aliasedId)) {
|
|
58
|
+
return BUILTIN_PERSONAS[aliasedId];
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
// Try to load as a file path
|
|
62
|
+
if (existsSync(personaSpec)) {
|
|
63
|
+
return loadPersonaFromFile(personaSpec);
|
|
64
|
+
}
|
|
65
|
+
// Check with common extensions
|
|
66
|
+
const extensions = ['.yaml', '.yml'];
|
|
67
|
+
for (const ext of extensions) {
|
|
68
|
+
const pathWithExt = personaSpec + ext;
|
|
69
|
+
if (existsSync(pathWithExt)) {
|
|
70
|
+
return loadPersonaFromFile(pathWithExt);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
throw new Error(`Unknown persona: "${personaSpec}". ` +
|
|
74
|
+
`Available built-in personas: technical_writer, security_tester, qa_engineer, novice_user`);
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Load a persona from a YAML file.
|
|
78
|
+
*/
|
|
79
|
+
export function loadPersonaFromFile(path) {
|
|
80
|
+
if (!existsSync(path)) {
|
|
81
|
+
throw new Error(`Persona file not found: ${path}`);
|
|
82
|
+
}
|
|
83
|
+
const content = readFileSync(path, 'utf-8');
|
|
84
|
+
const parsed = parseYamlSecure(content);
|
|
85
|
+
return validateAndNormalizePersona(parsed, path);
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Validate and normalize a persona definition.
|
|
89
|
+
*/
|
|
90
|
+
function validateAndNormalizePersona(data, source) {
|
|
91
|
+
// Required fields - basic checks first
|
|
92
|
+
if (!data.id || typeof data.id !== 'string') {
|
|
93
|
+
throw new Error(`Persona from ${source} missing required field: id`);
|
|
94
|
+
}
|
|
95
|
+
if (!data.name || typeof data.name !== 'string') {
|
|
96
|
+
throw new Error(`Persona from ${source} missing required field: name`);
|
|
97
|
+
}
|
|
98
|
+
if (!data.systemPrompt || typeof data.systemPrompt !== 'string') {
|
|
99
|
+
throw new Error(`Persona from ${source} missing required field: systemPrompt`);
|
|
100
|
+
}
|
|
101
|
+
// Normalize question bias with defaults
|
|
102
|
+
const defaultBias = {
|
|
103
|
+
happyPath: MATH_FACTORS.DEFAULT_QUESTION_BIAS,
|
|
104
|
+
edgeCase: MATH_FACTORS.DEFAULT_QUESTION_BIAS,
|
|
105
|
+
errorHandling: MATH_FACTORS.DEFAULT_QUESTION_BIAS,
|
|
106
|
+
boundary: MATH_FACTORS.DEFAULT_QUESTION_BIAS,
|
|
107
|
+
};
|
|
108
|
+
let questionBias = {
|
|
109
|
+
...defaultBias,
|
|
110
|
+
...(data.questionBias ?? {}),
|
|
111
|
+
};
|
|
112
|
+
// Normalize categories
|
|
113
|
+
const defaultCategories = ['happy_path', 'edge_case', 'error_handling'];
|
|
114
|
+
const categories = data.categories ?? defaultCategories;
|
|
115
|
+
// Create the persona object
|
|
116
|
+
const persona = {
|
|
117
|
+
id: data.id,
|
|
118
|
+
name: data.name,
|
|
119
|
+
description: data.description ?? `Custom persona: ${data.name}`,
|
|
120
|
+
systemPrompt: data.systemPrompt,
|
|
121
|
+
questionBias,
|
|
122
|
+
categories,
|
|
123
|
+
additionalContext: data.additionalContext,
|
|
124
|
+
builtin: false,
|
|
125
|
+
};
|
|
126
|
+
// Run comprehensive validation
|
|
127
|
+
const validationResult = validatePersona(persona, {
|
|
128
|
+
// Allow some flexibility for custom personas
|
|
129
|
+
warnUnusedBiases: true,
|
|
130
|
+
allowMissingSecurity: false,
|
|
131
|
+
});
|
|
132
|
+
if (!validationResult.valid) {
|
|
133
|
+
throw new Error(formatValidationErrors(validationResult, source));
|
|
134
|
+
}
|
|
135
|
+
// Log warnings if any
|
|
136
|
+
if (validationResult.warnings.length > 0) {
|
|
137
|
+
const logger = getLogger('persona-loader');
|
|
138
|
+
for (const warning of validationResult.warnings) {
|
|
139
|
+
logger.warn({ source, warning }, 'Persona validation warning');
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
// Normalize bias weights if they don't sum to 1.0
|
|
143
|
+
const sum = Object.values(questionBias).filter(v => typeof v === 'number').reduce((a, b) => a + b, 0);
|
|
144
|
+
if (Math.abs(sum - 1.0) > 0.01) {
|
|
145
|
+
questionBias = normalizeBiasWeights(questionBias);
|
|
146
|
+
persona.questionBias = questionBias;
|
|
147
|
+
}
|
|
148
|
+
return persona;
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Generate a sample custom persona YAML.
|
|
152
|
+
*/
|
|
153
|
+
export function generateSamplePersonaYaml() {
|
|
154
|
+
return `# Custom Persona Definition
|
|
155
|
+
# Save this file and reference it with: --persona-file ./my-persona.yaml
|
|
156
|
+
|
|
157
|
+
id: custom_auditor
|
|
158
|
+
name: Compliance Auditor
|
|
159
|
+
description: Tests for compliance with security and data handling requirements
|
|
160
|
+
|
|
161
|
+
systemPrompt: |
|
|
162
|
+
You are a compliance auditor testing an API for regulatory requirements.
|
|
163
|
+
Focus on data handling, privacy, and security compliance.
|
|
164
|
+
Test for:
|
|
165
|
+
- Sensitive data exposure in responses
|
|
166
|
+
- Proper error handling without information leakage
|
|
167
|
+
- Input validation and sanitization
|
|
168
|
+
- Access control boundaries
|
|
169
|
+
|
|
170
|
+
questionBias:
|
|
171
|
+
happyPath: 0.2
|
|
172
|
+
edgeCase: 0.2
|
|
173
|
+
errorHandling: 0.3
|
|
174
|
+
boundary: 0.15
|
|
175
|
+
security: 0.15
|
|
176
|
+
|
|
177
|
+
categories:
|
|
178
|
+
- error_handling
|
|
179
|
+
- security
|
|
180
|
+
- boundary
|
|
181
|
+
|
|
182
|
+
additionalContext: |
|
|
183
|
+
Compliance areas to verify:
|
|
184
|
+
- PII handling and masking
|
|
185
|
+
- Error message sanitization
|
|
186
|
+
- Rate limiting behavior
|
|
187
|
+
- Authentication requirements
|
|
188
|
+
`;
|
|
189
|
+
}
|
|
190
|
+
//# sourceMappingURL=loader.js.map
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Persona types for configurable interviewer personalities.
|
|
3
|
+
*/
|
|
4
|
+
import type { InterviewQuestion } from '../interview/types.js';
|
|
5
|
+
/**
|
|
6
|
+
* Question categories that can be weighted by personas.
|
|
7
|
+
*/
|
|
8
|
+
export type QuestionCategory = 'happy_path' | 'edge_case' | 'error_handling' | 'boundary' | 'security';
|
|
9
|
+
/**
|
|
10
|
+
* Weight distribution for question categories.
|
|
11
|
+
* Values should be 0-1 and represent relative likelihood.
|
|
12
|
+
*/
|
|
13
|
+
export interface QuestionBias {
|
|
14
|
+
/** Normal, expected usage patterns */
|
|
15
|
+
happyPath: number;
|
|
16
|
+
/** Boundary values and unusual but valid inputs */
|
|
17
|
+
edgeCase: number;
|
|
18
|
+
/** Invalid inputs and error conditions */
|
|
19
|
+
errorHandling: number;
|
|
20
|
+
/** Limits, extremes, and constraints */
|
|
21
|
+
boundary: number;
|
|
22
|
+
/** Security-focused tests (injection, traversal, etc.) */
|
|
23
|
+
security?: number;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Built-in persona identifiers.
|
|
27
|
+
*/
|
|
28
|
+
export type BuiltInPersonaId = 'technical_writer' | 'security_tester' | 'qa_engineer' | 'novice_user';
|
|
29
|
+
/**
|
|
30
|
+
* A persona defines an interviewer's personality and focus.
|
|
31
|
+
*/
|
|
32
|
+
export interface Persona {
|
|
33
|
+
/** Unique identifier */
|
|
34
|
+
id: string;
|
|
35
|
+
/** Human-readable name */
|
|
36
|
+
name: string;
|
|
37
|
+
/** Description of the persona's focus */
|
|
38
|
+
description: string;
|
|
39
|
+
/** System prompt that shapes LLM behavior */
|
|
40
|
+
systemPrompt: string;
|
|
41
|
+
/** Weight distribution for question categories */
|
|
42
|
+
questionBias: QuestionBias;
|
|
43
|
+
/** Categories this persona focuses on */
|
|
44
|
+
categories: QuestionCategory[];
|
|
45
|
+
/** Additional context to include in prompts */
|
|
46
|
+
additionalContext?: string;
|
|
47
|
+
/** Whether this is a built-in persona */
|
|
48
|
+
builtin?: boolean;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Result of interviewing with a specific persona.
|
|
52
|
+
*/
|
|
53
|
+
export interface PersonaInterviewResult {
|
|
54
|
+
/** Persona used for this interview */
|
|
55
|
+
persona: Persona;
|
|
56
|
+
/** Questions generated by this persona */
|
|
57
|
+
questions: InterviewQuestion[];
|
|
58
|
+
/** Findings specific to this persona's focus */
|
|
59
|
+
findings: PersonaFinding[];
|
|
60
|
+
/** Security issues found (security persona only) */
|
|
61
|
+
securityIssues?: SecurityIssue[];
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* A finding from a persona-focused interview.
|
|
65
|
+
*/
|
|
66
|
+
export interface PersonaFinding {
|
|
67
|
+
/** Tool this finding relates to */
|
|
68
|
+
tool: string;
|
|
69
|
+
/** Category of finding */
|
|
70
|
+
category: QuestionCategory;
|
|
71
|
+
/** Severity level */
|
|
72
|
+
severity: 'info' | 'low' | 'medium' | 'high' | 'critical';
|
|
73
|
+
/** Short title */
|
|
74
|
+
title: string;
|
|
75
|
+
/** Detailed description */
|
|
76
|
+
description: string;
|
|
77
|
+
/** Evidence supporting this finding */
|
|
78
|
+
evidence?: string;
|
|
79
|
+
/** Suggested remediation */
|
|
80
|
+
recommendation?: string;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Security issue found during security persona testing.
|
|
84
|
+
*/
|
|
85
|
+
export interface SecurityIssue {
|
|
86
|
+
/** Type of security issue */
|
|
87
|
+
type: SecurityIssueType;
|
|
88
|
+
/** Tool affected */
|
|
89
|
+
tool: string;
|
|
90
|
+
/** Severity */
|
|
91
|
+
severity: 'low' | 'medium' | 'high' | 'critical';
|
|
92
|
+
/** Description of the issue */
|
|
93
|
+
description: string;
|
|
94
|
+
/** Payload or input that triggered the issue */
|
|
95
|
+
payload?: string;
|
|
96
|
+
/** Response that indicates vulnerability */
|
|
97
|
+
response?: string;
|
|
98
|
+
/** CWE ID if applicable */
|
|
99
|
+
cweId?: string;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Types of security issues to detect.
|
|
103
|
+
*/
|
|
104
|
+
export type SecurityIssueType = 'path_traversal' | 'command_injection' | 'sql_injection' | 'xss' | 'ssrf' | 'information_disclosure' | 'authentication_bypass' | 'authorization_bypass' | 'dos' | 'other';
|
|
105
|
+
/**
|
|
106
|
+
* Configuration for loading personas.
|
|
107
|
+
*/
|
|
108
|
+
export interface PersonaConfig {
|
|
109
|
+
/** Persona ID or path to YAML file */
|
|
110
|
+
persona: string | string[];
|
|
111
|
+
/** Path to custom persona file */
|
|
112
|
+
personaFile?: string;
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* YAML schema for custom persona definitions.
|
|
116
|
+
*/
|
|
117
|
+
export interface PersonaYAML {
|
|
118
|
+
id: string;
|
|
119
|
+
name: string;
|
|
120
|
+
description: string;
|
|
121
|
+
systemPrompt: string;
|
|
122
|
+
questionBias: QuestionBias;
|
|
123
|
+
categories: QuestionCategory[];
|
|
124
|
+
additionalContext?: string;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Aggregated results from multiple personas.
|
|
128
|
+
*/
|
|
129
|
+
export interface AggregatedPersonaResults {
|
|
130
|
+
/** Results from each persona */
|
|
131
|
+
byPersona: Map<string, PersonaInterviewResult>;
|
|
132
|
+
/** Findings that appeared across multiple personas */
|
|
133
|
+
commonFindings: PersonaFinding[];
|
|
134
|
+
/** Unique findings per persona */
|
|
135
|
+
uniqueFindings: Map<string, PersonaFinding[]>;
|
|
136
|
+
/** Overall security assessment */
|
|
137
|
+
securitySummary?: {
|
|
138
|
+
issueCount: number;
|
|
139
|
+
criticalCount: number;
|
|
140
|
+
highCount: number;
|
|
141
|
+
issues: SecurityIssue[];
|
|
142
|
+
};
|
|
143
|
+
}
|
|
144
|
+
//# sourceMappingURL=types.d.ts.map
|