@avi770/testteam 2.0.0 → 3.2.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 +188 -3
- package/README.md +111 -20
- package/bin/testteam.js +32 -4
- package/dist/agents/01-analyst.d.ts +2 -2
- package/dist/agents/01-analyst.js +1 -1
- package/dist/agents/02-seed-architect.d.ts +2 -2
- package/dist/agents/02-seed-architect.js +2 -2
- package/dist/agents/03-test-generator.d.ts +2 -2
- package/dist/agents/03-test-generator.js +2 -2
- package/dist/agents/04-unit-runner.d.ts +2 -2
- package/dist/agents/04-unit-runner.d.ts.map +1 -1
- package/dist/agents/04-unit-runner.js +12 -3
- package/dist/agents/04-unit-runner.js.map +1 -1
- package/dist/agents/05-browser-crawler.d.ts +2 -2
- package/dist/agents/05-browser-crawler.d.ts.map +1 -1
- package/dist/agents/05-browser-crawler.js +24 -12
- package/dist/agents/05-browser-crawler.js.map +1 -1
- package/dist/agents/06-api-exerciser.d.ts +2 -2
- package/dist/agents/06-api-exerciser.js +2 -2
- package/dist/agents/07-security-scout.d.ts +2 -2
- package/dist/agents/07-security-scout.js +2 -2
- package/dist/agents/08-a11y-guardian.d.ts +2 -2
- package/dist/agents/08-a11y-guardian.d.ts.map +1 -1
- package/dist/agents/08-a11y-guardian.js +9 -5
- package/dist/agents/08-a11y-guardian.js.map +1 -1
- package/dist/agents/09-healer.d.ts +2 -2
- package/dist/agents/09-healer.js +2 -2
- package/dist/agents/10-reporter.d.ts +2 -2
- package/dist/agents/10-reporter.d.ts.map +1 -1
- package/dist/agents/10-reporter.js +55 -27
- package/dist/agents/10-reporter.js.map +1 -1
- package/dist/agents/100-error-handling-auditor.d.ts +63 -0
- package/dist/agents/100-error-handling-auditor.d.ts.map +1 -0
- package/dist/agents/100-error-handling-auditor.js +334 -0
- package/dist/agents/100-error-handling-auditor.js.map +1 -0
- package/dist/agents/101-rate-limit-auditor.d.ts +72 -0
- package/dist/agents/101-rate-limit-auditor.d.ts.map +1 -0
- package/dist/agents/101-rate-limit-auditor.js +295 -0
- package/dist/agents/101-rate-limit-auditor.js.map +1 -0
- package/dist/agents/102-dockerfile-auditor.d.ts +62 -0
- package/dist/agents/102-dockerfile-auditor.d.ts.map +1 -0
- package/dist/agents/102-dockerfile-auditor.js +337 -0
- package/dist/agents/102-dockerfile-auditor.js.map +1 -0
- package/dist/agents/103-ci-workflow-auditor.d.ts +57 -0
- package/dist/agents/103-ci-workflow-auditor.d.ts.map +1 -0
- package/dist/agents/103-ci-workflow-auditor.js +247 -0
- package/dist/agents/103-ci-workflow-auditor.js.map +1 -0
- package/dist/agents/104-n-plus-one-detector.d.ts +57 -0
- package/dist/agents/104-n-plus-one-detector.d.ts.map +1 -0
- package/dist/agents/104-n-plus-one-detector.js +329 -0
- package/dist/agents/104-n-plus-one-detector.js.map +1 -0
- package/dist/agents/105-unbounded-query-auditor.d.ts +50 -0
- package/dist/agents/105-unbounded-query-auditor.d.ts.map +1 -0
- package/dist/agents/105-unbounded-query-auditor.js +284 -0
- package/dist/agents/105-unbounded-query-auditor.js.map +1 -0
- package/dist/agents/106-hardcoded-config-auditor.d.ts +54 -0
- package/dist/agents/106-hardcoded-config-auditor.d.ts.map +1 -0
- package/dist/agents/106-hardcoded-config-auditor.js +251 -0
- package/dist/agents/106-hardcoded-config-auditor.js.map +1 -0
- package/dist/agents/107-open-redirect-detector.d.ts +52 -0
- package/dist/agents/107-open-redirect-detector.d.ts.map +1 -0
- package/dist/agents/107-open-redirect-detector.js +263 -0
- package/dist/agents/107-open-redirect-detector.js.map +1 -0
- package/dist/agents/108-sql-injection-detector.d.ts +51 -0
- package/dist/agents/108-sql-injection-detector.d.ts.map +1 -0
- package/dist/agents/108-sql-injection-detector.js +323 -0
- package/dist/agents/108-sql-injection-detector.js.map +1 -0
- package/dist/agents/109-path-traversal-detector.d.ts +51 -0
- package/dist/agents/109-path-traversal-detector.d.ts.map +1 -0
- package/dist/agents/109-path-traversal-detector.js +244 -0
- package/dist/agents/109-path-traversal-detector.js.map +1 -0
- package/dist/agents/11-fixer.d.ts +4 -2
- package/dist/agents/11-fixer.d.ts.map +1 -1
- package/dist/agents/11-fixer.js +52 -11
- package/dist/agents/11-fixer.js.map +1 -1
- package/dist/agents/110-mass-assignment-detector.d.ts +52 -0
- package/dist/agents/110-mass-assignment-detector.d.ts.map +1 -0
- package/dist/agents/110-mass-assignment-detector.js +199 -0
- package/dist/agents/110-mass-assignment-detector.js.map +1 -0
- package/dist/agents/111-dynamic-eval-detector.d.ts +46 -0
- package/dist/agents/111-dynamic-eval-detector.d.ts.map +1 -0
- package/dist/agents/111-dynamic-eval-detector.js +233 -0
- package/dist/agents/111-dynamic-eval-detector.js.map +1 -0
- package/dist/agents/112-taint-tracker.d.ts +226 -0
- package/dist/agents/112-taint-tracker.d.ts.map +1 -0
- package/dist/agents/112-taint-tracker.js +1273 -0
- package/dist/agents/112-taint-tracker.js.map +1 -0
- package/dist/agents/113-response-contract-auditor.d.ts +92 -0
- package/dist/agents/113-response-contract-auditor.d.ts.map +1 -0
- package/dist/agents/113-response-contract-auditor.js +694 -0
- package/dist/agents/113-response-contract-auditor.js.map +1 -0
- package/dist/agents/114-static-a11y-auditor.d.ts +66 -0
- package/dist/agents/114-static-a11y-auditor.d.ts.map +1 -0
- package/dist/agents/114-static-a11y-auditor.js +377 -0
- package/dist/agents/114-static-a11y-auditor.js.map +1 -0
- package/dist/agents/115-multihop-taint-tracker.d.ts +84 -0
- package/dist/agents/115-multihop-taint-tracker.d.ts.map +1 -0
- package/dist/agents/115-multihop-taint-tracker.js +340 -0
- package/dist/agents/115-multihop-taint-tracker.js.map +1 -0
- package/dist/agents/116-runtime-contract-capture.d.ts +79 -0
- package/dist/agents/116-runtime-contract-capture.d.ts.map +1 -0
- package/dist/agents/116-runtime-contract-capture.js +274 -0
- package/dist/agents/116-runtime-contract-capture.js.map +1 -0
- package/dist/agents/117-aria-rule-engine.d.ts +52 -0
- package/dist/agents/117-aria-rule-engine.d.ts.map +1 -0
- package/dist/agents/117-aria-rule-engine.js +415 -0
- package/dist/agents/117-aria-rule-engine.js.map +1 -0
- package/dist/agents/118-insecure-crypto-auditor.d.ts +48 -0
- package/dist/agents/118-insecure-crypto-auditor.d.ts.map +1 -0
- package/dist/agents/118-insecure-crypto-auditor.js +232 -0
- package/dist/agents/118-insecure-crypto-auditor.js.map +1 -0
- package/dist/agents/119-secrets-scanner.d.ts +44 -0
- package/dist/agents/119-secrets-scanner.d.ts.map +1 -0
- package/dist/agents/119-secrets-scanner.js +242 -0
- package/dist/agents/119-secrets-scanner.js.map +1 -0
- package/dist/agents/12-ux-inspector.d.ts +2 -2
- package/dist/agents/12-ux-inspector.d.ts.map +1 -1
- package/dist/agents/12-ux-inspector.js +8 -4
- package/dist/agents/12-ux-inspector.js.map +1 -1
- package/dist/agents/120-async-safety-auditor.d.ts +48 -0
- package/dist/agents/120-async-safety-auditor.d.ts.map +1 -0
- package/dist/agents/120-async-safety-auditor.js +250 -0
- package/dist/agents/120-async-safety-auditor.js.map +1 -0
- package/dist/agents/13-performance-profiler.d.ts +2 -2
- package/dist/agents/13-performance-profiler.d.ts.map +1 -1
- package/dist/agents/13-performance-profiler.js +5 -4
- package/dist/agents/13-performance-profiler.js.map +1 -1
- package/dist/agents/14-data-integrity-auditor.d.ts +2 -2
- package/dist/agents/14-data-integrity-auditor.js +4 -4
- package/dist/agents/14-data-integrity-auditor.js.map +1 -1
- package/dist/agents/15-regression-sentinel.d.ts +6 -4
- package/dist/agents/15-regression-sentinel.d.ts.map +1 -1
- package/dist/agents/15-regression-sentinel.js +5 -4
- package/dist/agents/15-regression-sentinel.js.map +1 -1
- package/dist/agents/16-chaos-agent.d.ts +2 -2
- package/dist/agents/16-chaos-agent.d.ts.map +1 -1
- package/dist/agents/16-chaos-agent.js +11 -4
- package/dist/agents/16-chaos-agent.js.map +1 -1
- package/dist/agents/17-documentation-validator.d.ts +2 -2
- package/dist/agents/17-documentation-validator.d.ts.map +1 -1
- package/dist/agents/17-documentation-validator.js +5 -2
- package/dist/agents/17-documentation-validator.js.map +1 -1
- package/dist/agents/18-integration-watchdog.d.ts +2 -2
- package/dist/agents/18-integration-watchdog.d.ts.map +1 -1
- package/dist/agents/18-integration-watchdog.js +5 -2
- package/dist/agents/18-integration-watchdog.js.map +1 -1
- package/dist/agents/19-tenant-isolation-auditor.d.ts +2 -2
- package/dist/agents/19-tenant-isolation-auditor.js +4 -4
- package/dist/agents/19-tenant-isolation-auditor.js.map +1 -1
- package/dist/agents/20-workflow-completion-tester.d.ts +2 -2
- package/dist/agents/20-workflow-completion-tester.d.ts.map +1 -1
- package/dist/agents/20-workflow-completion-tester.js +10 -6
- package/dist/agents/20-workflow-completion-tester.js.map +1 -1
- package/dist/agents/21-state-session-tester.d.ts +2 -2
- package/dist/agents/21-state-session-tester.d.ts.map +1 -1
- package/dist/agents/21-state-session-tester.js +15 -5
- package/dist/agents/21-state-session-tester.js.map +1 -1
- package/dist/agents/22-email-notification-verifier.d.ts +2 -2
- package/dist/agents/22-email-notification-verifier.js +2 -2
- package/dist/agents/23-migration-tester.d.ts +2 -2
- package/dist/agents/23-migration-tester.js +1 -1
- package/dist/agents/24-signup-onboarding-tester.d.ts +2 -2
- package/dist/agents/24-signup-onboarding-tester.d.ts.map +1 -1
- package/dist/agents/24-signup-onboarding-tester.js +13 -10
- package/dist/agents/24-signup-onboarding-tester.js.map +1 -1
- package/dist/agents/25-crud-flow-tester.d.ts +2 -2
- package/dist/agents/25-crud-flow-tester.d.ts.map +1 -1
- package/dist/agents/25-crud-flow-tester.js +12 -6
- package/dist/agents/25-crud-flow-tester.js.map +1 -1
- package/dist/agents/26-form-validator.d.ts +2 -2
- package/dist/agents/26-form-validator.d.ts.map +1 -1
- package/dist/agents/26-form-validator.js +12 -6
- package/dist/agents/26-form-validator.js.map +1 -1
- package/dist/agents/27-search-filter-tester.d.ts +2 -2
- package/dist/agents/27-search-filter-tester.d.ts.map +1 -1
- package/dist/agents/27-search-filter-tester.js +12 -6
- package/dist/agents/27-search-filter-tester.js.map +1 -1
- package/dist/agents/28-navigation-routing-tester.d.ts +2 -2
- package/dist/agents/28-navigation-routing-tester.d.ts.map +1 -1
- package/dist/agents/28-navigation-routing-tester.js +12 -6
- package/dist/agents/28-navigation-routing-tester.js.map +1 -1
- package/dist/agents/29-responsive-interaction-tester.d.ts +2 -2
- package/dist/agents/29-responsive-interaction-tester.d.ts.map +1 -1
- package/dist/agents/29-responsive-interaction-tester.js +12 -6
- package/dist/agents/29-responsive-interaction-tester.js.map +1 -1
- package/dist/agents/30-multi-user-scenario-tester.d.ts +2 -2
- package/dist/agents/30-multi-user-scenario-tester.d.ts.map +1 -1
- package/dist/agents/30-multi-user-scenario-tester.js +20 -13
- package/dist/agents/30-multi-user-scenario-tester.js.map +1 -1
- package/dist/agents/31-load-tester.d.ts +2 -2
- package/dist/agents/31-load-tester.js +2 -2
- package/dist/agents/32-memory-leak-detector.d.ts +2 -2
- package/dist/agents/32-memory-leak-detector.d.ts.map +1 -1
- package/dist/agents/32-memory-leak-detector.js +5 -4
- package/dist/agents/32-memory-leak-detector.js.map +1 -1
- package/dist/agents/33-bundle-analyzer.d.ts +2 -2
- package/dist/agents/33-bundle-analyzer.js +1 -1
- package/dist/agents/34-xss-scanner.d.ts +2 -2
- package/dist/agents/34-xss-scanner.d.ts.map +1 -1
- package/dist/agents/34-xss-scanner.js +12 -6
- package/dist/agents/34-xss-scanner.js.map +1 -1
- package/dist/agents/35-csrf-tester.d.ts +2 -2
- package/dist/agents/35-csrf-tester.js +2 -2
- package/dist/agents/36-auth-fuzzer.d.ts +2 -2
- package/dist/agents/36-auth-fuzzer.js +2 -2
- package/dist/agents/37-dependency-scanner.d.ts +2 -2
- package/dist/agents/37-dependency-scanner.js +1 -1
- package/dist/agents/38-secrets-scanner.d.ts +2 -2
- package/dist/agents/38-secrets-scanner.d.ts.map +1 -1
- package/dist/agents/38-secrets-scanner.js +39 -4
- package/dist/agents/38-secrets-scanner.js.map +1 -1
- package/dist/agents/39-api-contract-tester.d.ts +2 -2
- package/dist/agents/39-api-contract-tester.js +2 -2
- package/dist/agents/40-rate-limit-tester.d.ts +2 -2
- package/dist/agents/40-rate-limit-tester.js +2 -2
- package/dist/agents/41-api-pagination-tester.d.ts +2 -2
- package/dist/agents/41-api-pagination-tester.js +2 -2
- package/dist/agents/42-graphql-tester.d.ts +2 -2
- package/dist/agents/42-graphql-tester.js +2 -2
- package/dist/agents/43-data-consistency-checker.d.ts +2 -2
- package/dist/agents/43-data-consistency-checker.js +3 -3
- package/dist/agents/44-backup-recovery-tester.d.ts +2 -2
- package/dist/agents/44-backup-recovery-tester.js +1 -1
- package/dist/agents/45-data-privacy-scanner.d.ts +2 -2
- package/dist/agents/45-data-privacy-scanner.js +3 -3
- package/dist/agents/46-seo-auditor.d.ts +2 -2
- package/dist/agents/46-seo-auditor.d.ts.map +1 -1
- package/dist/agents/46-seo-auditor.js +12 -6
- package/dist/agents/46-seo-auditor.js.map +1 -1
- package/dist/agents/47-social-preview-tester.d.ts +2 -2
- package/dist/agents/47-social-preview-tester.d.ts.map +1 -1
- package/dist/agents/47-social-preview-tester.js +12 -6
- package/dist/agents/47-social-preview-tester.js.map +1 -1
- package/dist/agents/48-lighthouse-auditor.d.ts +2 -2
- package/dist/agents/48-lighthouse-auditor.d.ts.map +1 -1
- package/dist/agents/48-lighthouse-auditor.js +5 -4
- package/dist/agents/48-lighthouse-auditor.js.map +1 -1
- package/dist/agents/49-i18n-tester.d.ts +2 -2
- package/dist/agents/49-i18n-tester.d.ts.map +1 -1
- package/dist/agents/49-i18n-tester.js +12 -6
- package/dist/agents/49-i18n-tester.js.map +1 -1
- package/dist/agents/50-timezone-tester.d.ts +2 -2
- package/dist/agents/50-timezone-tester.d.ts.map +1 -1
- package/dist/agents/50-timezone-tester.js +40 -33
- package/dist/agents/50-timezone-tester.js.map +1 -1
- package/dist/agents/51-error-recovery-tester.d.ts +2 -2
- package/dist/agents/51-error-recovery-tester.d.ts.map +1 -1
- package/dist/agents/51-error-recovery-tester.js +12 -7
- package/dist/agents/51-error-recovery-tester.js.map +1 -1
- package/dist/agents/52-offline-mode-tester.d.ts +2 -2
- package/dist/agents/52-offline-mode-tester.d.ts.map +1 -1
- package/dist/agents/52-offline-mode-tester.js +12 -7
- package/dist/agents/52-offline-mode-tester.js.map +1 -1
- package/dist/agents/53-graceful-degradation-tester.d.ts +2 -2
- package/dist/agents/53-graceful-degradation-tester.d.ts.map +1 -1
- package/dist/agents/53-graceful-degradation-tester.js +10 -3
- package/dist/agents/53-graceful-degradation-tester.js.map +1 -1
- package/dist/agents/54-websocket-tester.d.ts +2 -2
- package/dist/agents/54-websocket-tester.d.ts.map +1 -1
- package/dist/agents/54-websocket-tester.js +12 -6
- package/dist/agents/54-websocket-tester.js.map +1 -1
- package/dist/agents/55-realtime-sync-tester.d.ts +2 -2
- package/dist/agents/55-realtime-sync-tester.d.ts.map +1 -1
- package/dist/agents/55-realtime-sync-tester.js +101 -96
- package/dist/agents/55-realtime-sync-tester.js.map +1 -1
- package/dist/agents/56-file-upload-tester.d.ts +2 -2
- package/dist/agents/56-file-upload-tester.d.ts.map +1 -1
- package/dist/agents/56-file-upload-tester.js +17 -13
- package/dist/agents/56-file-upload-tester.js.map +1 -1
- package/dist/agents/57-export-tester.d.ts +2 -2
- package/dist/agents/57-export-tester.d.ts.map +1 -1
- package/dist/agents/57-export-tester.js +8 -4
- package/dist/agents/57-export-tester.js.map +1 -1
- package/dist/agents/58-payment-flow-tester.d.ts +2 -2
- package/dist/agents/58-payment-flow-tester.d.ts.map +1 -1
- package/dist/agents/58-payment-flow-tester.js +8 -4
- package/dist/agents/58-payment-flow-tester.js.map +1 -1
- package/dist/agents/59-ssl-tls-auditor.d.ts +2 -2
- package/dist/agents/59-ssl-tls-auditor.js +2 -2
- package/dist/agents/60-dns-cdn-tester.d.ts +2 -2
- package/dist/agents/60-dns-cdn-tester.js +2 -2
- package/dist/agents/61-docker-health-checker.d.ts +2 -2
- package/dist/agents/61-docker-health-checker.js +1 -1
- package/dist/agents/62-env-config-validator.d.ts +2 -2
- package/dist/agents/62-env-config-validator.js +1 -1
- package/dist/agents/63-log-quality-auditor.d.ts +2 -2
- package/dist/agents/63-log-quality-auditor.js +1 -1
- package/dist/agents/64-analytics-tracker-tester.d.ts +2 -2
- package/dist/agents/64-analytics-tracker-tester.d.ts.map +1 -1
- package/dist/agents/64-analytics-tracker-tester.js +8 -4
- package/dist/agents/64-analytics-tracker-tester.js.map +1 -1
- package/dist/agents/65-gdpr-compliance-tester.d.ts +2 -2
- package/dist/agents/65-gdpr-compliance-tester.d.ts.map +1 -1
- package/dist/agents/65-gdpr-compliance-tester.js +55 -40
- package/dist/agents/65-gdpr-compliance-tester.js.map +1 -1
- package/dist/agents/66-soc2-control-validator.d.ts +2 -2
- package/dist/agents/66-soc2-control-validator.d.ts.map +1 -1
- package/dist/agents/66-soc2-control-validator.js +29 -21
- package/dist/agents/66-soc2-control-validator.js.map +1 -1
- package/dist/agents/67-wcag-aaa-tester.d.ts +2 -2
- package/dist/agents/67-wcag-aaa-tester.d.ts.map +1 -1
- package/dist/agents/67-wcag-aaa-tester.js +12 -6
- package/dist/agents/67-wcag-aaa-tester.js.map +1 -1
- package/dist/agents/68-dead-code-detector.d.ts +2 -2
- package/dist/agents/68-dead-code-detector.d.ts.map +1 -1
- package/dist/agents/68-dead-code-detector.js +6 -3
- package/dist/agents/68-dead-code-detector.js.map +1 -1
- package/dist/agents/69-type-safety-auditor.d.ts +2 -2
- package/dist/agents/69-type-safety-auditor.js +1 -1
- package/dist/agents/70-complexity-analyzer.d.ts +2 -2
- package/dist/agents/70-complexity-analyzer.js +1 -1
- package/dist/agents/71-unit-testing-agent.d.ts +15 -0
- package/dist/agents/71-unit-testing-agent.d.ts.map +1 -0
- package/dist/agents/71-unit-testing-agent.js +220 -0
- package/dist/agents/71-unit-testing-agent.js.map +1 -0
- package/dist/agents/72-integration-testing-agent.d.ts +13 -0
- package/dist/agents/72-integration-testing-agent.d.ts.map +1 -0
- package/dist/agents/72-integration-testing-agent.js +243 -0
- package/dist/agents/72-integration-testing-agent.js.map +1 -0
- package/dist/agents/73-system-testing-agent.d.ts +11 -0
- package/dist/agents/73-system-testing-agent.d.ts.map +1 -0
- package/dist/agents/73-system-testing-agent.js +175 -0
- package/dist/agents/73-system-testing-agent.js.map +1 -0
- package/dist/agents/74-acceptance-testing-agent.d.ts +13 -0
- package/dist/agents/74-acceptance-testing-agent.d.ts.map +1 -0
- package/dist/agents/74-acceptance-testing-agent.js +254 -0
- package/dist/agents/74-acceptance-testing-agent.js.map +1 -0
- package/dist/agents/75-sanity-testing-agent.d.ts +15 -0
- package/dist/agents/75-sanity-testing-agent.d.ts.map +1 -0
- package/dist/agents/75-sanity-testing-agent.js +240 -0
- package/dist/agents/75-sanity-testing-agent.js.map +1 -0
- package/dist/agents/76-regression-testing-agent.d.ts +14 -0
- package/dist/agents/76-regression-testing-agent.d.ts.map +1 -0
- package/dist/agents/76-regression-testing-agent.js +230 -0
- package/dist/agents/76-regression-testing-agent.js.map +1 -0
- package/dist/agents/77-browser-load-testing-agent.d.ts +11 -0
- package/dist/agents/77-browser-load-testing-agent.d.ts.map +1 -0
- package/dist/agents/77-browser-load-testing-agent.js +128 -0
- package/dist/agents/77-browser-load-testing-agent.js.map +1 -0
- package/dist/agents/78-stress-testing-agent.d.ts +11 -0
- package/dist/agents/78-stress-testing-agent.d.ts.map +1 -0
- package/dist/agents/78-stress-testing-agent.js +146 -0
- package/dist/agents/78-stress-testing-agent.js.map +1 -0
- package/dist/agents/79-endurance-testing-agent.d.ts +12 -0
- package/dist/agents/79-endurance-testing-agent.d.ts.map +1 -0
- package/dist/agents/79-endurance-testing-agent.js +165 -0
- package/dist/agents/79-endurance-testing-agent.js.map +1 -0
- package/dist/agents/80-usability-testing-agent.d.ts +11 -0
- package/dist/agents/80-usability-testing-agent.d.ts.map +1 -0
- package/dist/agents/80-usability-testing-agent.js +196 -0
- package/dist/agents/80-usability-testing-agent.js.map +1 -0
- package/dist/agents/81-compatibility-testing-agent.d.ts +11 -0
- package/dist/agents/81-compatibility-testing-agent.d.ts.map +1 -0
- package/dist/agents/81-compatibility-testing-agent.js +224 -0
- package/dist/agents/81-compatibility-testing-agent.js.map +1 -0
- package/dist/agents/82-exploratory-testing-agent.d.ts +14 -0
- package/dist/agents/82-exploratory-testing-agent.d.ts.map +1 -0
- package/dist/agents/82-exploratory-testing-agent.js +345 -0
- package/dist/agents/82-exploratory-testing-agent.js.map +1 -0
- package/dist/agents/83-static-analysis-agent.d.ts +14 -0
- package/dist/agents/83-static-analysis-agent.d.ts.map +1 -0
- package/dist/agents/83-static-analysis-agent.js +261 -0
- package/dist/agents/83-static-analysis-agent.js.map +1 -0
- package/dist/agents/84-governance-testing-agent.d.ts +28 -0
- package/dist/agents/84-governance-testing-agent.d.ts.map +1 -0
- package/dist/agents/84-governance-testing-agent.js +591 -0
- package/dist/agents/84-governance-testing-agent.js.map +1 -0
- package/dist/agents/85-stagehand-agent.d.ts +22 -0
- package/dist/agents/85-stagehand-agent.d.ts.map +1 -0
- package/dist/agents/85-stagehand-agent.js +81 -0
- package/dist/agents/85-stagehand-agent.js.map +1 -0
- package/dist/agents/86-browser-use-agent.d.ts +31 -0
- package/dist/agents/86-browser-use-agent.d.ts.map +1 -0
- package/dist/agents/86-browser-use-agent.js +121 -0
- package/dist/agents/86-browser-use-agent.js.map +1 -0
- package/dist/agents/87-connection-mapper.d.ts +93 -0
- package/dist/agents/87-connection-mapper.d.ts.map +1 -0
- package/dist/agents/87-connection-mapper.js +658 -0
- package/dist/agents/87-connection-mapper.js.map +1 -0
- package/dist/agents/88-localhost-walkthrough.d.ts +272 -0
- package/dist/agents/88-localhost-walkthrough.d.ts.map +1 -0
- package/dist/agents/88-localhost-walkthrough.js +1203 -0
- package/dist/agents/88-localhost-walkthrough.js.map +1 -0
- package/dist/agents/89-repair-retest.d.ts +63 -0
- package/dist/agents/89-repair-retest.d.ts.map +1 -0
- package/dist/agents/89-repair-retest.js +227 -0
- package/dist/agents/89-repair-retest.js.map +1 -0
- package/dist/agents/90-response-shape-validator.d.ts +35 -0
- package/dist/agents/90-response-shape-validator.d.ts.map +1 -0
- package/dist/agents/90-response-shape-validator.js +156 -0
- package/dist/agents/90-response-shape-validator.js.map +1 -0
- package/dist/agents/91-boundary-fuzzer.d.ts +99 -0
- package/dist/agents/91-boundary-fuzzer.d.ts.map +1 -0
- package/dist/agents/91-boundary-fuzzer.js +0 -0
- package/dist/agents/91-boundary-fuzzer.js.map +1 -0
- package/dist/agents/92-repair-simulator.d.ts +89 -0
- package/dist/agents/92-repair-simulator.d.ts.map +1 -0
- package/dist/agents/92-repair-simulator.js +401 -0
- package/dist/agents/92-repair-simulator.js.map +1 -0
- package/dist/agents/93-env-var-auditor.d.ts +64 -0
- package/dist/agents/93-env-var-auditor.d.ts.map +1 -0
- package/dist/agents/93-env-var-auditor.js +435 -0
- package/dist/agents/93-env-var-auditor.js.map +1 -0
- package/dist/agents/94-schema-validator.d.ts +148 -0
- package/dist/agents/94-schema-validator.d.ts.map +1 -0
- package/dist/agents/94-schema-validator.js +567 -0
- package/dist/agents/94-schema-validator.js.map +1 -0
- package/dist/agents/95-contract-drift.d.ts +87 -0
- package/dist/agents/95-contract-drift.d.ts.map +1 -0
- package/dist/agents/95-contract-drift.js +335 -0
- package/dist/agents/95-contract-drift.js.map +1 -0
- package/dist/agents/96-cookie-security-auditor.d.ts +86 -0
- package/dist/agents/96-cookie-security-auditor.d.ts.map +1 -0
- package/dist/agents/96-cookie-security-auditor.js +339 -0
- package/dist/agents/96-cookie-security-auditor.js.map +1 -0
- package/dist/agents/97-healthcheck-validator.d.ts +62 -0
- package/dist/agents/97-healthcheck-validator.d.ts.map +1 -0
- package/dist/agents/97-healthcheck-validator.js +204 -0
- package/dist/agents/97-healthcheck-validator.js.map +1 -0
- package/dist/agents/98-cors-csp-auditor.d.ts +70 -0
- package/dist/agents/98-cors-csp-auditor.d.ts.map +1 -0
- package/dist/agents/98-cors-csp-auditor.js +308 -0
- package/dist/agents/98-cors-csp-auditor.js.map +1 -0
- package/dist/agents/99-logging-hygiene-auditor.d.ts +67 -0
- package/dist/agents/99-logging-hygiene-auditor.d.ts.map +1 -0
- package/dist/agents/99-logging-hygiene-auditor.js +325 -0
- package/dist/agents/99-logging-hygiene-auditor.js.map +1 -0
- package/dist/agents/base-agent.d.ts +75 -3
- package/dist/agents/base-agent.d.ts.map +1 -1
- package/dist/agents/base-agent.js +112 -1
- package/dist/agents/base-agent.js.map +1 -1
- package/dist/agents/browser-use-client.d.ts +68 -0
- package/dist/agents/browser-use-client.d.ts.map +1 -0
- package/dist/agents/browser-use-client.js +92 -0
- package/dist/agents/browser-use-client.js.map +1 -0
- package/dist/agents/lib/source-scan.d.ts +53 -0
- package/dist/agents/lib/source-scan.d.ts.map +1 -0
- package/dist/agents/lib/source-scan.js +279 -0
- package/dist/agents/lib/source-scan.js.map +1 -0
- package/dist/agents/registry.d.ts +27 -8
- package/dist/agents/registry.d.ts.map +1 -1
- package/dist/agents/registry.js +365 -151
- package/dist/agents/registry.js.map +1 -1
- package/dist/agents/stagehand-runner.d.ts +104 -0
- package/dist/agents/stagehand-runner.d.ts.map +1 -0
- package/dist/agents/stagehand-runner.js +153 -0
- package/dist/agents/stagehand-runner.js.map +1 -0
- package/dist/bridge/agent-registry.d.ts +21 -0
- package/dist/bridge/agent-registry.d.ts.map +1 -0
- package/dist/bridge/agent-registry.js +224 -0
- package/dist/bridge/agent-registry.js.map +1 -0
- package/dist/bridge/api-contract-reader.d.ts +55 -0
- package/dist/bridge/api-contract-reader.d.ts.map +1 -0
- package/dist/bridge/api-contract-reader.js +103 -0
- package/dist/bridge/api-contract-reader.js.map +1 -0
- package/dist/bridge/compliance-reader.d.ts +47 -0
- package/dist/bridge/compliance-reader.d.ts.map +1 -0
- package/dist/bridge/compliance-reader.js +91 -0
- package/dist/bridge/compliance-reader.js.map +1 -0
- package/dist/bridge/data-integrity-reader.d.ts +77 -0
- package/dist/bridge/data-integrity-reader.d.ts.map +1 -0
- package/dist/bridge/data-integrity-reader.js +110 -0
- package/dist/bridge/data-integrity-reader.js.map +1 -0
- package/dist/bridge/design-reader.d.ts +51 -0
- package/dist/bridge/design-reader.d.ts.map +1 -0
- package/dist/bridge/design-reader.js +105 -0
- package/dist/bridge/design-reader.js.map +1 -0
- package/dist/bridge/file-scanner.d.ts +21 -0
- package/dist/bridge/file-scanner.d.ts.map +1 -0
- package/dist/bridge/file-scanner.js +117 -0
- package/dist/bridge/file-scanner.js.map +1 -0
- package/dist/bridge/finding-normalize.d.ts +24 -0
- package/dist/bridge/finding-normalize.d.ts.map +1 -0
- package/dist/bridge/finding-normalize.js +46 -0
- package/dist/bridge/finding-normalize.js.map +1 -0
- package/dist/bridge/http-client.d.ts +44 -0
- package/dist/bridge/http-client.d.ts.map +1 -0
- package/dist/bridge/http-client.js +130 -0
- package/dist/bridge/http-client.js.map +1 -0
- package/dist/bridge/knowledge-reader.d.ts +10 -0
- package/dist/bridge/knowledge-reader.d.ts.map +1 -0
- package/dist/bridge/knowledge-reader.js +46 -0
- package/dist/bridge/knowledge-reader.js.map +1 -0
- package/dist/bridge/loop-engine-reader.d.ts +77 -0
- package/dist/bridge/loop-engine-reader.d.ts.map +1 -0
- package/dist/bridge/loop-engine-reader.js +73 -0
- package/dist/bridge/loop-engine-reader.js.map +1 -0
- package/dist/bridge/playwright-pool.d.ts +33 -0
- package/dist/bridge/playwright-pool.d.ts.map +1 -0
- package/dist/bridge/playwright-pool.js +89 -0
- package/dist/bridge/playwright-pool.js.map +1 -0
- package/dist/bridge/rate-limiter.d.ts +40 -0
- package/dist/bridge/rate-limiter.d.ts.map +1 -0
- package/dist/bridge/rate-limiter.js +33 -0
- package/dist/bridge/rate-limiter.js.map +1 -0
- package/dist/bridge/reliability-reader.d.ts +67 -0
- package/dist/bridge/reliability-reader.d.ts.map +1 -0
- package/dist/bridge/reliability-reader.js +146 -0
- package/dist/bridge/reliability-reader.js.map +1 -0
- package/dist/bridge/router.d.ts +26 -0
- package/dist/bridge/router.d.ts.map +1 -0
- package/dist/bridge/router.js +137 -0
- package/dist/bridge/router.js.map +1 -0
- package/dist/bridge/run-stream.d.ts +47 -0
- package/dist/bridge/run-stream.d.ts.map +1 -0
- package/dist/bridge/run-stream.js +67 -0
- package/dist/bridge/run-stream.js.map +1 -0
- package/dist/bridge/runs-reader.d.ts +41 -0
- package/dist/bridge/runs-reader.d.ts.map +1 -0
- package/dist/bridge/runs-reader.js +185 -0
- package/dist/bridge/runs-reader.js.map +1 -0
- package/dist/bridge/sentinel-reader.d.ts +55 -0
- package/dist/bridge/sentinel-reader.d.ts.map +1 -0
- package/dist/bridge/sentinel-reader.js +88 -0
- package/dist/bridge/sentinel-reader.js.map +1 -0
- package/dist/bridge/server.d.ts +83 -0
- package/dist/bridge/server.d.ts.map +1 -0
- package/dist/bridge/server.js +1103 -0
- package/dist/bridge/server.js.map +1 -0
- package/dist/bridge/shell-executor.d.ts +49 -0
- package/dist/bridge/shell-executor.d.ts.map +1 -0
- package/dist/bridge/shell-executor.js +181 -0
- package/dist/bridge/shell-executor.js.map +1 -0
- package/dist/bridge/tech-debt-reader.d.ts +57 -0
- package/dist/bridge/tech-debt-reader.d.ts.map +1 -0
- package/dist/bridge/tech-debt-reader.js +119 -0
- package/dist/bridge/tech-debt-reader.js.map +1 -0
- package/dist/bridge/types.d.ts +63 -0
- package/dist/bridge/types.d.ts.map +1 -0
- package/dist/bridge/types.js +7 -0
- package/dist/bridge/types.js.map +1 -0
- package/dist/clients/agent-mvp.d.ts +68 -0
- package/dist/clients/agent-mvp.d.ts.map +1 -0
- package/dist/clients/agent-mvp.js +102 -0
- package/dist/clients/agent-mvp.js.map +1 -0
- package/dist/clients/llm-council.d.ts +47 -0
- package/dist/clients/llm-council.d.ts.map +1 -0
- package/dist/clients/llm-council.js +52 -0
- package/dist/clients/llm-council.js.map +1 -0
- package/dist/clients/total-recall.d.ts +37 -0
- package/dist/clients/total-recall.d.ts.map +1 -0
- package/dist/clients/total-recall.js +239 -0
- package/dist/clients/total-recall.js.map +1 -0
- package/dist/core/agent-contract.d.ts +21 -0
- package/dist/core/agent-contract.d.ts.map +1 -0
- package/dist/core/agent-contract.js +18 -0
- package/dist/core/agent-contract.js.map +1 -0
- package/dist/core/api-contract/api-contract-validator.d.ts +178 -0
- package/dist/core/api-contract/api-contract-validator.d.ts.map +1 -0
- package/dist/core/api-contract/api-contract-validator.js +796 -0
- package/dist/core/api-contract/api-contract-validator.js.map +1 -0
- package/dist/core/api-contract/index.d.ts +16 -0
- package/dist/core/api-contract/index.d.ts.map +1 -0
- package/dist/core/api-contract/index.js +24 -0
- package/dist/core/api-contract/index.js.map +1 -0
- package/dist/core/api-contract/types.d.ts +235 -0
- package/dist/core/api-contract/types.d.ts.map +1 -0
- package/dist/core/api-contract/types.js +27 -0
- package/dist/core/api-contract/types.js.map +1 -0
- package/dist/core/blackboard/blackboard.d.ts +34 -0
- package/dist/core/blackboard/blackboard.d.ts.map +1 -0
- package/dist/core/blackboard/blackboard.js +133 -0
- package/dist/core/blackboard/blackboard.js.map +1 -0
- package/dist/core/blackboard/coordination.d.ts +27 -0
- package/dist/core/blackboard/coordination.d.ts.map +1 -0
- package/dist/core/blackboard/coordination.js +31 -0
- package/dist/core/blackboard/coordination.js.map +1 -0
- package/dist/core/blackboard/direct-channel.d.ts +26 -0
- package/dist/core/blackboard/direct-channel.d.ts.map +1 -0
- package/dist/core/blackboard/direct-channel.js +26 -0
- package/dist/core/blackboard/direct-channel.js.map +1 -0
- package/dist/core/blackboard/index.d.ts +10 -0
- package/dist/core/blackboard/index.d.ts.map +1 -0
- package/dist/core/blackboard/index.js +4 -0
- package/dist/core/blackboard/index.js.map +1 -0
- package/dist/core/blackboard/types.d.ts +36 -0
- package/dist/core/blackboard/types.d.ts.map +1 -0
- package/dist/core/blackboard/types.js +2 -0
- package/dist/core/blackboard/types.js.map +1 -0
- package/dist/core/canvas/schema.d.ts +81 -0
- package/dist/core/canvas/schema.d.ts.map +1 -0
- package/dist/core/canvas/schema.js +144 -0
- package/dist/core/canvas/schema.js.map +1 -0
- package/dist/core/canvas/store.d.ts +41 -0
- package/dist/core/canvas/store.d.ts.map +1 -0
- package/dist/core/canvas/store.js +121 -0
- package/dist/core/canvas/store.js.map +1 -0
- package/dist/core/ci-output.d.ts +1 -1
- package/dist/core/ci-output.d.ts.map +1 -1
- package/dist/core/ci-output.js +2 -0
- package/dist/core/ci-output.js.map +1 -1
- package/dist/core/cli.d.ts +15 -1
- package/dist/core/cli.d.ts.map +1 -1
- package/dist/core/cli.js +416 -35
- package/dist/core/cli.js.map +1 -1
- package/dist/core/compliance/auditor.d.ts +119 -0
- package/dist/core/compliance/auditor.d.ts.map +1 -0
- package/dist/core/compliance/auditor.js +577 -0
- package/dist/core/compliance/auditor.js.map +1 -0
- package/dist/core/compliance/index.d.ts +11 -0
- package/dist/core/compliance/index.d.ts.map +1 -0
- package/dist/core/compliance/index.js +10 -0
- package/dist/core/compliance/index.js.map +1 -0
- package/dist/core/compliance/types.d.ts +174 -0
- package/dist/core/compliance/types.d.ts.map +1 -0
- package/dist/core/compliance/types.js +12 -0
- package/dist/core/compliance/types.js.map +1 -0
- package/dist/core/conductor/conductor.d.ts +37 -0
- package/dist/core/conductor/conductor.d.ts.map +1 -0
- package/dist/core/conductor/conductor.js +96 -0
- package/dist/core/conductor/conductor.js.map +1 -0
- package/dist/core/conductor/index.d.ts +9 -0
- package/dist/core/conductor/index.d.ts.map +1 -0
- package/dist/core/conductor/index.js +3 -0
- package/dist/core/conductor/index.js.map +1 -0
- package/dist/core/conductor/model-router.d.ts +17 -0
- package/dist/core/conductor/model-router.d.ts.map +1 -0
- package/dist/core/conductor/model-router.js +29 -0
- package/dist/core/conductor/model-router.js.map +1 -0
- package/dist/core/conductor/types.d.ts +33 -0
- package/dist/core/conductor/types.d.ts.map +1 -0
- package/dist/core/conductor/types.js +2 -0
- package/dist/core/conductor/types.js.map +1 -0
- package/dist/core/config.d.ts +148 -1
- package/dist/core/config.d.ts.map +1 -1
- package/dist/core/config.js +53 -4
- package/dist/core/config.js.map +1 -1
- package/dist/core/data-integrity/data-integrity.d.ts +291 -0
- package/dist/core/data-integrity/data-integrity.d.ts.map +1 -0
- package/dist/core/data-integrity/data-integrity.js +892 -0
- package/dist/core/data-integrity/data-integrity.js.map +1 -0
- package/dist/core/data-integrity/index.d.ts +16 -0
- package/dist/core/data-integrity/index.d.ts.map +1 -0
- package/dist/core/data-integrity/index.js +17 -0
- package/dist/core/data-integrity/index.js.map +1 -0
- package/dist/core/data-integrity/types.d.ts +236 -0
- package/dist/core/data-integrity/types.d.ts.map +1 -0
- package/dist/core/data-integrity/types.js +14 -0
- package/dist/core/data-integrity/types.js.map +1 -0
- package/dist/core/disaster-recovery/index.d.ts +13 -0
- package/dist/core/disaster-recovery/index.d.ts.map +1 -0
- package/dist/core/disaster-recovery/index.js +3 -0
- package/dist/core/disaster-recovery/index.js.map +1 -0
- package/dist/core/disaster-recovery/simulator.d.ts +158 -0
- package/dist/core/disaster-recovery/simulator.d.ts.map +1 -0
- package/dist/core/disaster-recovery/simulator.js +553 -0
- package/dist/core/disaster-recovery/simulator.js.map +1 -0
- package/dist/core/disaster-recovery/types.d.ts +299 -0
- package/dist/core/disaster-recovery/types.d.ts.map +1 -0
- package/dist/core/disaster-recovery/types.js +33 -0
- package/dist/core/disaster-recovery/types.js.map +1 -0
- package/dist/core/escalation/heal-or-ask.d.ts +20 -0
- package/dist/core/escalation/heal-or-ask.d.ts.map +1 -0
- package/dist/core/escalation/heal-or-ask.js +19 -0
- package/dist/core/escalation/heal-or-ask.js.map +1 -0
- package/dist/core/escalation/index.d.ts +9 -0
- package/dist/core/escalation/index.d.ts.map +1 -0
- package/dist/core/escalation/index.js +3 -0
- package/dist/core/escalation/index.js.map +1 -0
- package/dist/core/escalation/pause-gate.d.ts +48 -0
- package/dist/core/escalation/pause-gate.d.ts.map +1 -0
- package/dist/core/escalation/pause-gate.js +96 -0
- package/dist/core/escalation/pause-gate.js.map +1 -0
- package/dist/core/escalation/types.d.ts +33 -0
- package/dist/core/escalation/types.d.ts.map +1 -0
- package/dist/core/escalation/types.js +9 -0
- package/dist/core/escalation/types.js.map +1 -0
- package/dist/core/evidence.d.ts +32 -1
- package/dist/core/evidence.d.ts.map +1 -1
- package/dist/core/evidence.js +99 -1
- package/dist/core/evidence.js.map +1 -1
- package/dist/core/feature-bdd/fix.d.ts +84 -0
- package/dist/core/feature-bdd/fix.d.ts.map +1 -0
- package/dist/core/feature-bdd/fix.js +121 -0
- package/dist/core/feature-bdd/fix.js.map +1 -0
- package/dist/core/feature-bdd/generate.d.ts +96 -0
- package/dist/core/feature-bdd/generate.d.ts.map +1 -0
- package/dist/core/feature-bdd/generate.js +228 -0
- package/dist/core/feature-bdd/generate.js.map +1 -0
- package/dist/core/feature-bdd/llm-provider.d.ts +92 -0
- package/dist/core/feature-bdd/llm-provider.d.ts.map +1 -0
- package/dist/core/feature-bdd/llm-provider.js +187 -0
- package/dist/core/feature-bdd/llm-provider.js.map +1 -0
- package/dist/core/feature-bdd/run.d.ts +56 -0
- package/dist/core/feature-bdd/run.d.ts.map +1 -0
- package/dist/core/feature-bdd/run.js +175 -0
- package/dist/core/feature-bdd/run.js.map +1 -0
- package/dist/core/feature-bdd/schema.d.ts +111 -0
- package/dist/core/feature-bdd/schema.d.ts.map +1 -0
- package/dist/core/feature-bdd/schema.js +272 -0
- package/dist/core/feature-bdd/schema.js.map +1 -0
- package/dist/core/feature-bdd/store.d.ts +145 -0
- package/dist/core/feature-bdd/store.d.ts.map +1 -0
- package/dist/core/feature-bdd/store.js +470 -0
- package/dist/core/feature-bdd/store.js.map +1 -0
- package/dist/core/finding-correlation.d.ts +55 -0
- package/dist/core/finding-correlation.d.ts.map +1 -0
- package/dist/core/finding-correlation.js +96 -0
- package/dist/core/finding-correlation.js.map +1 -0
- package/dist/core/fix-loop.d.ts +20 -1
- package/dist/core/fix-loop.d.ts.map +1 -1
- package/dist/core/fix-loop.js +34 -0
- package/dist/core/fix-loop.js.map +1 -1
- package/dist/core/governance/calibration.d.ts +31 -0
- package/dist/core/governance/calibration.d.ts.map +1 -0
- package/dist/core/governance/calibration.js +78 -0
- package/dist/core/governance/calibration.js.map +1 -0
- package/dist/core/governance/degradation.d.ts +35 -0
- package/dist/core/governance/degradation.d.ts.map +1 -0
- package/dist/core/governance/degradation.js +25 -0
- package/dist/core/governance/degradation.js.map +1 -0
- package/dist/core/governance/ethical-constraint.d.ts +55 -0
- package/dist/core/governance/ethical-constraint.d.ts.map +1 -0
- package/dist/core/governance/ethical-constraint.js +98 -0
- package/dist/core/governance/ethical-constraint.js.map +1 -0
- package/dist/core/governance/index.d.ts +9 -0
- package/dist/core/governance/index.d.ts.map +1 -0
- package/dist/core/governance/index.js +9 -0
- package/dist/core/governance/index.js.map +1 -0
- package/dist/core/harness/audit-log.d.ts +12 -0
- package/dist/core/harness/audit-log.d.ts.map +1 -0
- package/dist/core/harness/audit-log.js +62 -0
- package/dist/core/harness/audit-log.js.map +1 -0
- package/dist/core/harness/authorization.d.ts +24 -0
- package/dist/core/harness/authorization.d.ts.map +1 -0
- package/dist/core/harness/authorization.js +48 -0
- package/dist/core/harness/authorization.js.map +1 -0
- package/dist/core/harness/harness.d.ts +64 -0
- package/dist/core/harness/harness.d.ts.map +1 -0
- package/dist/core/harness/harness.js +188 -0
- package/dist/core/harness/harness.js.map +1 -0
- package/dist/core/harness/index.d.ts +10 -0
- package/dist/core/harness/index.d.ts.map +1 -0
- package/dist/core/harness/index.js +4 -0
- package/dist/core/harness/index.js.map +1 -0
- package/dist/core/harness/types.d.ts +88 -0
- package/dist/core/harness/types.d.ts.map +1 -0
- package/dist/core/harness/types.js +2 -0
- package/dist/core/harness/types.js.map +1 -0
- package/dist/core/health-check.d.ts +6 -0
- package/dist/core/health-check.d.ts.map +1 -1
- package/dist/core/health-check.js +14 -2
- package/dist/core/health-check.js.map +1 -1
- package/dist/core/init.d.ts.map +1 -1
- package/dist/core/init.js +58 -18
- package/dist/core/init.js.map +1 -1
- package/dist/core/knowledge/cached-map.d.ts +17 -0
- package/dist/core/knowledge/cached-map.d.ts.map +1 -0
- package/dist/core/knowledge/cached-map.js +23 -0
- package/dist/core/knowledge/cached-map.js.map +1 -0
- package/dist/core/knowledge/index.d.ts +10 -0
- package/dist/core/knowledge/index.d.ts.map +1 -0
- package/dist/core/knowledge/index.js +4 -0
- package/dist/core/knowledge/index.js.map +1 -0
- package/dist/core/knowledge/system-map.d.ts +50 -0
- package/dist/core/knowledge/system-map.d.ts.map +1 -0
- package/dist/core/knowledge/system-map.js +121 -0
- package/dist/core/knowledge/system-map.js.map +1 -0
- package/dist/core/knowledge/traversal.d.ts +12 -0
- package/dist/core/knowledge/traversal.d.ts.map +1 -0
- package/dist/core/knowledge/traversal.js +37 -0
- package/dist/core/knowledge/traversal.js.map +1 -0
- package/dist/core/knowledge/types.d.ts +41 -0
- package/dist/core/knowledge/types.d.ts.map +1 -0
- package/dist/core/knowledge/types.js +2 -0
- package/dist/core/knowledge/types.js.map +1 -0
- package/dist/core/license-gen.d.ts +1 -1
- package/dist/core/license-gen.d.ts.map +1 -1
- package/dist/core/license-gen.js +10 -5
- package/dist/core/license-gen.js.map +1 -1
- package/dist/core/license.d.ts +12 -2
- package/dist/core/license.d.ts.map +1 -1
- package/dist/core/license.js +104 -28
- package/dist/core/license.js.map +1 -1
- package/dist/core/loop-engine/circuit-breaker.d.ts +24 -0
- package/dist/core/loop-engine/circuit-breaker.d.ts.map +1 -0
- package/dist/core/loop-engine/circuit-breaker.js +48 -0
- package/dist/core/loop-engine/circuit-breaker.js.map +1 -0
- package/dist/core/loop-engine/demo.d.ts +35 -0
- package/dist/core/loop-engine/demo.d.ts.map +1 -0
- package/dist/core/loop-engine/demo.js +71 -0
- package/dist/core/loop-engine/demo.js.map +1 -0
- package/dist/core/loop-engine/event-store.d.ts +8 -0
- package/dist/core/loop-engine/event-store.d.ts.map +1 -0
- package/dist/core/loop-engine/event-store.js +9 -0
- package/dist/core/loop-engine/event-store.js.map +1 -0
- package/dist/core/loop-engine/index.d.ts +11 -0
- package/dist/core/loop-engine/index.d.ts.map +1 -0
- package/dist/core/loop-engine/index.js +11 -0
- package/dist/core/loop-engine/index.js.map +1 -0
- package/dist/core/loop-engine/kernel.d.ts +66 -0
- package/dist/core/loop-engine/kernel.d.ts.map +1 -0
- package/dist/core/loop-engine/kernel.js +196 -0
- package/dist/core/loop-engine/kernel.js.map +1 -0
- package/dist/core/loop-engine/tracing.d.ts +12 -0
- package/dist/core/loop-engine/tracing.d.ts.map +1 -0
- package/dist/core/loop-engine/tracing.js +15 -0
- package/dist/core/loop-engine/tracing.js.map +1 -0
- package/dist/core/loop-engine/types.d.ts +92 -0
- package/dist/core/loop-engine/types.d.ts.map +1 -0
- package/dist/core/loop-engine/types.js +21 -0
- package/dist/core/loop-engine/types.js.map +1 -0
- package/dist/core/messages.d.ts +1 -1
- package/dist/core/messages.d.ts.map +1 -1
- package/dist/core/messages.js +101 -1
- package/dist/core/messages.js.map +1 -1
- package/dist/core/orchestrator.d.ts +87 -7
- package/dist/core/orchestrator.d.ts.map +1 -1
- package/dist/core/orchestrator.js +399 -33
- package/dist/core/orchestrator.js.map +1 -1
- package/dist/core/phase-gate.d.ts +2 -2
- package/dist/core/quality-score/calculator.d.ts +125 -0
- package/dist/core/quality-score/calculator.d.ts.map +1 -0
- package/dist/core/quality-score/calculator.js +489 -0
- package/dist/core/quality-score/calculator.js.map +1 -0
- package/dist/core/quality-score/from-run.d.ts +27 -0
- package/dist/core/quality-score/from-run.d.ts.map +1 -0
- package/dist/core/quality-score/from-run.js +64 -0
- package/dist/core/quality-score/from-run.js.map +1 -0
- package/dist/core/quality-score/index.d.ts +9 -0
- package/dist/core/quality-score/index.d.ts.map +1 -0
- package/dist/core/quality-score/index.js +9 -0
- package/dist/core/quality-score/index.js.map +1 -0
- package/dist/core/quality-score/types.d.ts +225 -0
- package/dist/core/quality-score/types.d.ts.map +1 -0
- package/dist/core/quality-score/types.js +26 -0
- package/dist/core/quality-score/types.js.map +1 -0
- package/dist/core/report-html-script.d.ts +3 -0
- package/dist/core/report-html-script.d.ts.map +1 -0
- package/dist/core/report-html-script.js +47 -0
- package/dist/core/report-html-script.js.map +1 -0
- package/dist/core/report-html-styles.d.ts +3 -0
- package/dist/core/report-html-styles.d.ts.map +1 -0
- package/dist/core/report-html-styles.js +231 -0
- package/dist/core/report-html-styles.js.map +1 -0
- package/dist/core/report-html.d.ts +1 -1
- package/dist/core/report-html.d.ts.map +1 -1
- package/dist/core/report-html.js +5 -280
- package/dist/core/report-html.js.map +1 -1
- package/dist/core/report-upload.d.ts +8 -0
- package/dist/core/report-upload.d.ts.map +1 -1
- package/dist/core/report-upload.js +17 -4
- package/dist/core/report-upload.js.map +1 -1
- package/dist/core/run-counter.d.ts.map +1 -1
- package/dist/core/run-counter.js +25 -1
- package/dist/core/run-counter.js.map +1 -1
- package/dist/core/run-events/emitter.d.ts +112 -0
- package/dist/core/run-events/emitter.d.ts.map +1 -0
- package/dist/core/run-events/emitter.js +234 -0
- package/dist/core/run-events/emitter.js.map +1 -0
- package/dist/core/run-events/frame-sink.d.ts +24 -0
- package/dist/core/run-events/frame-sink.d.ts.map +1 -0
- package/dist/core/run-events/frame-sink.js +32 -0
- package/dist/core/run-events/frame-sink.js.map +1 -0
- package/dist/core/run-events/index.d.ts +7 -0
- package/dist/core/run-events/index.d.ts.map +1 -0
- package/dist/core/run-events/index.js +5 -0
- package/dist/core/run-events/index.js.map +1 -0
- package/dist/core/run-events/loop-event-sink.d.ts +56 -0
- package/dist/core/run-events/loop-event-sink.d.ts.map +1 -0
- package/dist/core/run-events/loop-event-sink.js +60 -0
- package/dist/core/run-events/loop-event-sink.js.map +1 -0
- package/dist/core/run-events/sse.d.ts +47 -0
- package/dist/core/run-events/sse.d.ts.map +1 -0
- package/dist/core/run-events/sse.js +64 -0
- package/dist/core/run-events/sse.js.map +1 -0
- package/dist/core/run-events/types.d.ts +147 -0
- package/dist/core/run-events/types.d.ts.map +1 -0
- package/dist/core/run-events/types.js +17 -0
- package/dist/core/run-events/types.js.map +1 -0
- package/dist/core/run-mode/capture.d.ts +37 -0
- package/dist/core/run-mode/capture.d.ts.map +1 -0
- package/dist/core/run-mode/capture.js +43 -0
- package/dist/core/run-mode/capture.js.map +1 -0
- package/dist/core/run-mode/index.d.ts +9 -0
- package/dist/core/run-mode/index.d.ts.map +1 -0
- package/dist/core/run-mode/index.js +3 -0
- package/dist/core/run-mode/index.js.map +1 -0
- package/dist/core/run-mode/run-mode.d.ts +35 -0
- package/dist/core/run-mode/run-mode.d.ts.map +1 -0
- package/dist/core/run-mode/run-mode.js +51 -0
- package/dist/core/run-mode/run-mode.js.map +1 -0
- package/dist/core/run-mode/types.d.ts +36 -0
- package/dist/core/run-mode/types.d.ts.map +1 -0
- package/dist/core/run-mode/types.js +15 -0
- package/dist/core/run-mode/types.js.map +1 -0
- package/dist/core/run-quota.d.ts +22 -0
- package/dist/core/run-quota.d.ts.map +1 -0
- package/dist/core/run-quota.js +44 -0
- package/dist/core/run-quota.js.map +1 -0
- package/dist/core/security-audit/index.d.ts +9 -0
- package/dist/core/security-audit/index.d.ts.map +1 -0
- package/dist/core/security-audit/index.js +10 -0
- package/dist/core/security-audit/index.js.map +1 -0
- package/dist/core/security-audit/sentinel.d.ts +196 -0
- package/dist/core/security-audit/sentinel.d.ts.map +1 -0
- package/dist/core/security-audit/sentinel.js +725 -0
- package/dist/core/security-audit/sentinel.js.map +1 -0
- package/dist/core/security-audit/types.d.ts +240 -0
- package/dist/core/security-audit/types.d.ts.map +1 -0
- package/dist/core/security-audit/types.js +42 -0
- package/dist/core/security-audit/types.js.map +1 -0
- package/dist/core/tech-debt/index.d.ts +11 -0
- package/dist/core/tech-debt/index.d.ts.map +1 -0
- package/dist/core/tech-debt/index.js +11 -0
- package/dist/core/tech-debt/index.js.map +1 -0
- package/dist/core/tech-debt/tech-debt-tracker.d.ts +46 -0
- package/dist/core/tech-debt/tech-debt-tracker.d.ts.map +1 -0
- package/dist/core/tech-debt/tech-debt-tracker.js +533 -0
- package/dist/core/tech-debt/tech-debt-tracker.js.map +1 -0
- package/dist/core/tech-debt/types.d.ts +263 -0
- package/dist/core/tech-debt/types.d.ts.map +1 -0
- package/dist/core/tech-debt/types.js +2 -0
- package/dist/core/tech-debt/types.js.map +1 -0
- package/dist/core/tester/diff-planner.d.ts +18 -0
- package/dist/core/tester/diff-planner.d.ts.map +1 -0
- package/dist/core/tester/diff-planner.js +37 -0
- package/dist/core/tester/diff-planner.js.map +1 -0
- package/dist/core/tester/honest-report.d.ts +13 -0
- package/dist/core/tester/honest-report.d.ts.map +1 -0
- package/dist/core/tester/honest-report.js +64 -0
- package/dist/core/tester/honest-report.js.map +1 -0
- package/dist/core/tester/index.d.ts +9 -0
- package/dist/core/tester/index.d.ts.map +1 -0
- package/dist/core/tester/index.js +3 -0
- package/dist/core/tester/index.js.map +1 -0
- package/dist/core/tester/types.d.ts +55 -0
- package/dist/core/tester/types.d.ts.map +1 -0
- package/dist/core/tester/types.js +8 -0
- package/dist/core/tester/types.js.map +1 -0
- package/dist/core/triggers/index.d.ts +9 -0
- package/dist/core/triggers/index.d.ts.map +1 -0
- package/dist/core/triggers/index.js +3 -0
- package/dist/core/triggers/index.js.map +1 -0
- package/dist/core/triggers/trigger-bus.d.ts +49 -0
- package/dist/core/triggers/trigger-bus.d.ts.map +1 -0
- package/dist/core/triggers/trigger-bus.js +167 -0
- package/dist/core/triggers/trigger-bus.js.map +1 -0
- package/dist/core/triggers/types.d.ts +56 -0
- package/dist/core/triggers/types.d.ts.map +1 -0
- package/dist/core/triggers/types.js +13 -0
- package/dist/core/triggers/types.js.map +1 -0
- package/dist/core/trust.d.ts +12 -0
- package/dist/core/trust.d.ts.map +1 -0
- package/dist/core/trust.js +13 -0
- package/dist/core/trust.js.map +1 -0
- package/dist/core/types.d.ts +24 -2
- package/dist/core/types.d.ts.map +1 -1
- package/dist/core/ui-ux/index.d.ts +12 -0
- package/dist/core/ui-ux/index.d.ts.map +1 -0
- package/dist/core/ui-ux/index.js +13 -0
- package/dist/core/ui-ux/index.js.map +1 -0
- package/dist/core/ui-ux/orchestrator.d.ts +206 -0
- package/dist/core/ui-ux/orchestrator.d.ts.map +1 -0
- package/dist/core/ui-ux/orchestrator.js +672 -0
- package/dist/core/ui-ux/orchestrator.js.map +1 -0
- package/dist/core/ui-ux/types.d.ts +339 -0
- package/dist/core/ui-ux/types.d.ts.map +1 -0
- package/dist/core/ui-ux/types.js +17 -0
- package/dist/core/ui-ux/types.js.map +1 -0
- package/dist/enterprise/audit-trail.d.ts +31 -0
- package/dist/enterprise/audit-trail.d.ts.map +1 -0
- package/dist/enterprise/audit-trail.js +111 -0
- package/dist/enterprise/audit-trail.js.map +1 -0
- package/dist/enterprise/sla.d.ts +26 -0
- package/dist/enterprise/sla.d.ts.map +1 -0
- package/dist/enterprise/sla.js +101 -0
- package/dist/enterprise/sla.js.map +1 -0
- package/dist/helpers/element-discovery.js +1 -1
- package/dist/helpers/element-discovery.js.map +1 -1
- package/dist/helpers/env-resolver.d.ts +2 -2
- package/dist/helpers/quality-gate.d.ts.map +1 -1
- package/dist/helpers/quality-gate.js +21 -3
- package/dist/helpers/quality-gate.js.map +1 -1
- package/dist/helpers/shape-fingerprint.d.ts +18 -0
- package/dist/helpers/shape-fingerprint.d.ts.map +1 -0
- package/dist/helpers/shape-fingerprint.js +40 -0
- package/dist/helpers/shape-fingerprint.js.map +1 -0
- package/dist/sdk/custom-agent.d.ts +51 -0
- package/dist/sdk/custom-agent.d.ts.map +1 -0
- package/dist/sdk/custom-agent.js +94 -0
- package/dist/sdk/custom-agent.js.map +1 -0
- package/dist/sdk/index.d.ts +5 -0
- package/dist/sdk/index.d.ts.map +1 -0
- package/dist/sdk/index.js +3 -0
- package/dist/sdk/index.js.map +1 -0
- package/dist/sdk/loader.d.ts +28 -0
- package/dist/sdk/loader.d.ts.map +1 -0
- package/dist/sdk/loader.js +140 -0
- package/dist/sdk/loader.js.map +1 -0
- package/package.json +46 -20
- package/agents/01-analyst.ts +0 -100
- package/agents/02-seed-architect.ts +0 -59
- package/agents/03-test-generator.ts +0 -191
- package/agents/04-unit-runner.ts +0 -160
- package/agents/05-browser-crawler.ts +0 -790
- package/agents/06-api-exerciser.ts +0 -311
- package/agents/07-security-scout.ts +0 -188
- package/agents/08-a11y-guardian.ts +0 -212
- package/agents/09-healer.ts +0 -228
- package/agents/10-reporter.ts +0 -266
- package/agents/11-fixer.ts +0 -253
- package/agents/12-ux-inspector.ts +0 -444
- package/agents/13-performance-profiler.ts +0 -271
- package/agents/14-data-integrity-auditor.ts +0 -417
- package/agents/15-regression-sentinel.ts +0 -307
- package/agents/16-chaos-agent.ts +0 -228
- package/agents/17-documentation-validator.ts +0 -266
- package/agents/18-integration-watchdog.ts +0 -178
- package/agents/19-tenant-isolation-auditor.ts +0 -199
- package/agents/20-workflow-completion-tester.ts +0 -203
- package/agents/21-state-session-tester.ts +0 -262
- package/agents/22-email-notification-verifier.ts +0 -244
- package/agents/23-migration-tester.ts +0 -80
- package/agents/24-signup-onboarding-tester.ts +0 -429
- package/agents/25-crud-flow-tester.ts +0 -302
- package/agents/26-form-validator.ts +0 -297
- package/agents/27-search-filter-tester.ts +0 -326
- package/agents/28-navigation-routing-tester.ts +0 -425
- package/agents/29-responsive-interaction-tester.ts +0 -350
- package/agents/30-multi-user-scenario-tester.ts +0 -319
- package/agents/31-load-tester.ts +0 -134
- package/agents/32-memory-leak-detector.ts +0 -194
- package/agents/33-bundle-analyzer.ts +0 -132
- package/agents/34-xss-scanner.ts +0 -191
- package/agents/35-csrf-tester.ts +0 -82
- package/agents/36-auth-fuzzer.ts +0 -194
- package/agents/37-dependency-scanner.ts +0 -176
- package/agents/38-secrets-scanner.ts +0 -137
- package/agents/39-api-contract-tester.ts +0 -199
- package/agents/40-rate-limit-tester.ts +0 -94
- package/agents/41-api-pagination-tester.ts +0 -97
- package/agents/42-graphql-tester.ts +0 -222
- package/agents/43-data-consistency-checker.ts +0 -205
- package/agents/44-backup-recovery-tester.ts +0 -152
- package/agents/45-data-privacy-scanner.ts +0 -125
- package/agents/46-seo-auditor.ts +0 -294
- package/agents/47-social-preview-tester.ts +0 -232
- package/agents/48-lighthouse-auditor.ts +0 -213
- package/agents/49-i18n-tester.ts +0 -198
- package/agents/50-timezone-tester.ts +0 -173
- package/agents/51-error-recovery-tester.ts +0 -155
- package/agents/52-offline-mode-tester.ts +0 -180
- package/agents/53-graceful-degradation-tester.ts +0 -156
- package/agents/54-websocket-tester.ts +0 -151
- package/agents/55-realtime-sync-tester.ts +0 -194
- package/agents/56-file-upload-tester.ts +0 -194
- package/agents/57-export-tester.ts +0 -174
- package/agents/58-payment-flow-tester.ts +0 -183
- package/agents/59-ssl-tls-auditor.ts +0 -141
- package/agents/60-dns-cdn-tester.ts +0 -117
- package/agents/61-docker-health-checker.ts +0 -111
- package/agents/62-env-config-validator.ts +0 -152
- package/agents/63-log-quality-auditor.ts +0 -136
- package/agents/64-analytics-tracker-tester.ts +0 -165
- package/agents/65-gdpr-compliance-tester.ts +0 -215
- package/agents/66-soc2-control-validator.ts +0 -210
- package/agents/67-wcag-aaa-tester.ts +0 -241
- package/agents/68-dead-code-detector.ts +0 -135
- package/agents/69-type-safety-auditor.ts +0 -164
- package/agents/70-complexity-analyzer.ts +0 -179
- package/agents/__tests__/01-analyst.test.ts +0 -188
- package/agents/__tests__/02-seed-architect.test.ts +0 -152
- package/agents/__tests__/03-test-generator-full.test.ts +0 -321
- package/agents/__tests__/03-test-generator.test.ts +0 -318
- package/agents/__tests__/04-unit-runner.test.ts +0 -320
- package/agents/__tests__/05-browser-crawler-beta.test.ts +0 -492
- package/agents/__tests__/05-browser-crawler-release.test.ts +0 -412
- package/agents/__tests__/05-browser-crawler-uat.test.ts +0 -578
- package/agents/__tests__/05-browser-crawler.test.ts +0 -518
- package/agents/__tests__/06-api-exerciser.test.ts +0 -619
- package/agents/__tests__/07-security-scout.test.ts +0 -382
- package/agents/__tests__/08-a11y-guardian.test.ts +0 -530
- package/agents/__tests__/09-healer.test.ts +0 -384
- package/agents/__tests__/10-reporter.test.ts +0 -366
- package/agents/__tests__/11-fixer.test.ts +0 -406
- package/agents/__tests__/12-ux-inspector-extended.test.ts +0 -465
- package/agents/__tests__/12-ux-inspector.test.ts +0 -443
- package/agents/__tests__/13-performance-profiler.test.ts +0 -411
- package/agents/__tests__/14-data-integrity-auditor-extended.test.ts +0 -573
- package/agents/__tests__/14-data-integrity-auditor.test.ts +0 -407
- package/agents/__tests__/15-regression-sentinel.test.ts +0 -657
- package/agents/__tests__/16-chaos-agent.test.ts +0 -427
- package/agents/__tests__/17-documentation-validator.test.ts +0 -402
- package/agents/__tests__/18-integration-watchdog.test.ts +0 -263
- package/agents/__tests__/19-tenant-isolation-auditor.test.ts +0 -400
- package/agents/__tests__/20-workflow-completion-tester.test.ts +0 -586
- package/agents/__tests__/21-state-session-tester.test.ts +0 -374
- package/agents/__tests__/22-email-notification-verifier.test.ts +0 -441
- package/agents/__tests__/23-migration-tester.test.ts +0 -145
- package/agents/__tests__/24-signup-onboarding-tester.test.ts +0 -274
- package/agents/__tests__/25-crud-flow-tester.test.ts +0 -322
- package/agents/__tests__/26-form-validator.test.ts +0 -345
- package/agents/__tests__/27-search-filter-tester.test.ts +0 -311
- package/agents/__tests__/28-navigation-routing-tester.test.ts +0 -328
- package/agents/__tests__/29-responsive-interaction-tester.test.ts +0 -297
- package/agents/__tests__/30-multi-user-scenario-tester.test.ts +0 -328
- package/agents/__tests__/31-load-tester.test.ts +0 -189
- package/agents/__tests__/32-memory-leak-detector.test.ts +0 -251
- package/agents/__tests__/33-bundle-analyzer.test.ts +0 -237
- package/agents/__tests__/34-xss-scanner.test.ts +0 -258
- package/agents/__tests__/35-csrf-tester.test.ts +0 -200
- package/agents/__tests__/36-auth-fuzzer.test.ts +0 -214
- package/agents/__tests__/37-dependency-scanner.test.ts +0 -266
- package/agents/__tests__/38-secrets-scanner.test.ts +0 -224
- package/agents/__tests__/39-api-contract-tester.test.ts +0 -312
- package/agents/__tests__/40-rate-limit-tester.test.ts +0 -192
- package/agents/__tests__/41-api-pagination-tester.test.ts +0 -198
- package/agents/__tests__/42-graphql-tester.test.ts +0 -252
- package/agents/__tests__/43-data-consistency-checker.test.ts +0 -232
- package/agents/__tests__/44-backup-recovery-tester.test.ts +0 -222
- package/agents/__tests__/45-data-privacy-scanner.test.ts +0 -223
- package/agents/__tests__/46-seo-auditor.test.ts +0 -261
- package/agents/__tests__/47-social-preview-tester.test.ts +0 -245
- package/agents/__tests__/48-lighthouse-auditor.test.ts +0 -276
- package/agents/__tests__/49-i18n-tester.test.ts +0 -201
- package/agents/__tests__/50-timezone-tester.test.ts +0 -172
- package/agents/__tests__/51-error-recovery-tester.test.ts +0 -162
- package/agents/__tests__/52-offline-mode-tester.test.ts +0 -164
- package/agents/__tests__/53-graceful-degradation-tester.test.ts +0 -168
- package/agents/__tests__/54-websocket-tester.test.ts +0 -157
- package/agents/__tests__/55-realtime-sync-tester.test.ts +0 -181
- package/agents/__tests__/56-file-upload-tester.test.ts +0 -172
- package/agents/__tests__/57-export-tester.test.ts +0 -169
- package/agents/__tests__/58-payment-flow-tester.test.ts +0 -182
- package/agents/__tests__/59-ssl-tls-auditor.test.ts +0 -179
- package/agents/__tests__/60-dns-cdn-tester.test.ts +0 -176
- package/agents/__tests__/61-docker-health-checker.test.ts +0 -150
- package/agents/__tests__/62-env-config-validator.test.ts +0 -166
- package/agents/__tests__/63-log-quality-auditor.test.ts +0 -175
- package/agents/__tests__/64-analytics-tracker-tester.test.ts +0 -158
- package/agents/__tests__/65-gdpr-compliance-tester.test.ts +0 -174
- package/agents/__tests__/66-soc2-control-validator.test.ts +0 -183
- package/agents/__tests__/67-wcag-aaa-tester.test.ts +0 -190
- package/agents/__tests__/68-dead-code-detector.test.ts +0 -174
- package/agents/__tests__/69-type-safety-auditor.test.ts +0 -173
- package/agents/__tests__/70-complexity-analyzer.test.ts +0 -177
- package/agents/__tests__/base-agent.test.ts +0 -188
- package/agents/__tests__/registry.test.ts +0 -218
- package/agents/base-agent.ts +0 -77
- package/agents/registry.ts +0 -277
- package/baselines/api-schemas/.gitkeep +0 -0
- package/baselines/performance/.gitkeep +0 -0
- package/baselines/screenshots/.gitkeep +0 -0
- package/core/__tests__/ci-output.test.ts +0 -430
- package/core/__tests__/cli.test.ts +0 -387
- package/core/__tests__/config.test.ts +0 -78
- package/core/__tests__/cost-tracker.test.ts +0 -158
- package/core/__tests__/evidence.test.ts +0 -265
- package/core/__tests__/fix-loop.test.ts +0 -210
- package/core/__tests__/health-check.test.ts +0 -44
- package/core/__tests__/init.test.ts +0 -609
- package/core/__tests__/integration.test.ts +0 -204
- package/core/__tests__/license-gen.test.ts +0 -227
- package/core/__tests__/license.test.ts +0 -326
- package/core/__tests__/multi-browser.test.ts +0 -278
- package/core/__tests__/orchestrator.test.ts +0 -520
- package/core/__tests__/phase-gate.test.ts +0 -43
- package/core/__tests__/report-html.test.ts +0 -398
- package/core/__tests__/report-upload.test.ts +0 -325
- package/core/__tests__/run-counter.test.ts +0 -234
- package/core/ci-output.ts +0 -240
- package/core/cli.ts +0 -232
- package/core/config.ts +0 -178
- package/core/cost-tracker.ts +0 -59
- package/core/evidence.ts +0 -132
- package/core/fix-loop.ts +0 -85
- package/core/health-check.ts +0 -54
- package/core/init.ts +0 -546
- package/core/license-gen.ts +0 -212
- package/core/license.ts +0 -208
- package/core/messages.ts +0 -67
- package/core/multi-browser.ts +0 -136
- package/core/orchestrator.ts +0 -356
- package/core/phase-gate.ts +0 -55
- package/core/report-html.ts +0 -657
- package/core/report-upload.ts +0 -188
- package/core/run-counter.ts +0 -175
- package/core/types.ts +0 -57
- package/dist/core/multi-browser.d.ts +0 -36
- package/dist/core/multi-browser.d.ts.map +0 -1
- package/dist/core/multi-browser.js +0 -88
- package/dist/core/multi-browser.js.map +0 -1
- package/helpers/__tests__/api-client.test.ts +0 -199
- package/helpers/__tests__/element-discovery.test.ts +0 -202
- package/helpers/__tests__/form-filler-extended.test.ts +0 -212
- package/helpers/__tests__/form-filler.test.ts +0 -99
- package/helpers/__tests__/modal-handler.test.ts +0 -152
- package/helpers/__tests__/navigation.test.ts +0 -214
- package/helpers/__tests__/quality-gate.test.ts +0 -117
- package/helpers/__tests__/screenshot.test.ts +0 -139
- package/helpers/__tests__/seed-validator.test.ts +0 -114
- package/helpers/api-client.ts +0 -111
- package/helpers/element-discovery.ts +0 -105
- package/helpers/env-resolver.ts +0 -69
- package/helpers/form-filler.ts +0 -126
- package/helpers/modal-handler.ts +0 -108
- package/helpers/navigation.ts +0 -100
- package/helpers/quality-gate.ts +0 -180
- package/helpers/screenshot.ts +0 -111
- package/helpers/seed-validator.ts +0 -70
|
@@ -0,0 +1,796 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* API Contract Validator (#11 — "The Border Guard") — implementation.
|
|
3
|
+
*
|
|
4
|
+
* This is a COMPOSITE RESULTS-PROCESSOR over the engine "api" squad (#39/#41/#42).
|
|
5
|
+
* It does NOT re-implement what those engines do at runtime (live HTTP fetch,
|
|
6
|
+
* pagination edge-case probing, GraphQL depth/introspection). Those remain the
|
|
7
|
+
* engine agents' jobs; this layer INGESTS their Finding[] output verbatim (see
|
|
8
|
+
* ValidateApiContractOptions.engineFindings → ApiContractReport.engineFindings) and
|
|
9
|
+
* adds the static/composite REST-contract capabilities that belong at this tier:
|
|
10
|
+
*
|
|
11
|
+
* - Spec-hash diff gating (skip unchanged endpoints, near-zero steady cost)
|
|
12
|
+
* - Breaking-change detection (RECURSIVE spec diff, block/warn classification)
|
|
13
|
+
* - Consumer-driven contracts (Pact — structural verification of provider interactions)
|
|
14
|
+
* - Runtime contract monitoring (sampled prod traffic schema + latency; unknown endpoints flagged)
|
|
15
|
+
* - Error-response contract validation
|
|
16
|
+
* - Mock generation from spec (msw handler strings)
|
|
17
|
+
* - Migration guide authoring (one entry per breaking change)
|
|
18
|
+
*
|
|
19
|
+
* Engine agent roles (NOT re-implemented here — surfaced via engineFindings):
|
|
20
|
+
* #39 ApiContractTester — live HTTP schema conformance
|
|
21
|
+
* #41 ApiPaginationTester — pagination edge-case probing
|
|
22
|
+
* #42 GraphqlTester — GraphQL introspection / depth / auth probing
|
|
23
|
+
*
|
|
24
|
+
* The composition is real (not just a comment): COMPOSED_ENGINE_AGENTS (./types) is
|
|
25
|
+
* asserted against the live AGENT_REGISTRY 'api' squad by the integration test, and the
|
|
26
|
+
* engine Finding[] are ingested into the report.
|
|
27
|
+
*
|
|
28
|
+
* Operating rules (spec §"Operating & safety rules"):
|
|
29
|
+
* - Read-only / non-destructive on the API. Never mutates endpoints.
|
|
30
|
+
* - Gates rather than fixes.
|
|
31
|
+
* - Diagnostic-first: distinguish spec bug from impl bug before blocking.
|
|
32
|
+
* - First-do-no-harm.
|
|
33
|
+
*
|
|
34
|
+
* Spec: blueprint/agents/11-api-contract-validator.md.
|
|
35
|
+
*/
|
|
36
|
+
import { createHash } from 'node:crypto';
|
|
37
|
+
// ---------------------------------------------------------------------------
|
|
38
|
+
// Spec-hash diff gating (#1 of the 10 improvements — "near-zero steady cost")
|
|
39
|
+
// ---------------------------------------------------------------------------
|
|
40
|
+
/**
|
|
41
|
+
* Produce a deterministic JSON string with sorted object keys at all nesting levels.
|
|
42
|
+
* This is required for a stable hash: JSON.stringify with a replacer-array only filters
|
|
43
|
+
* top-level keys, not nested ones, so nested objects would serialize as {} — making all
|
|
44
|
+
* operations produce the same hash regardless of their schema content.
|
|
45
|
+
*/
|
|
46
|
+
function stableStringify(value) {
|
|
47
|
+
if (value === null || typeof value !== 'object') {
|
|
48
|
+
return JSON.stringify(value);
|
|
49
|
+
}
|
|
50
|
+
if (Array.isArray(value)) {
|
|
51
|
+
return '[' + value.map(stableStringify).join(',') + ']';
|
|
52
|
+
}
|
|
53
|
+
const record = value;
|
|
54
|
+
const sortedKeys = Object.keys(record).sort();
|
|
55
|
+
return '{' + sortedKeys.map((k) => JSON.stringify(k) + ':' + stableStringify(record[k])).join(',') + '}';
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Compute a deterministic SHA-256 fingerprint of one endpoint's spec fragment.
|
|
59
|
+
* Only the operation JSON is hashed — stable and independent of spec metadata.
|
|
60
|
+
* Uses stableStringify to guarantee key-order independence (JSON.stringify key order
|
|
61
|
+
* is insertion-order in V8, which is not guaranteed canonical across environments).
|
|
62
|
+
*/
|
|
63
|
+
export function hashEndpointSpec(path, method, operation) {
|
|
64
|
+
const canonical = stableStringify({ method: method.toUpperCase(), operation, path });
|
|
65
|
+
const specHash = createHash('sha256').update(canonical).digest('hex').slice(0, 16);
|
|
66
|
+
return { path, method: method.toUpperCase(), specHash };
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Given the current spec and a registry of last-validated hashes, return the set of endpoints
|
|
70
|
+
* that MUST be re-validated (their hash changed or they are new) and the set that can be skipped.
|
|
71
|
+
* Unchanged endpoints (same spec hash) skip schema re-validation — this gates spec-diff cost,
|
|
72
|
+
* NOT a proof of implementation conformance (runtime-sample monitoring still applies).
|
|
73
|
+
*/
|
|
74
|
+
export function partitionByHash(spec, registry) {
|
|
75
|
+
const toValidate = [];
|
|
76
|
+
const skipped = [];
|
|
77
|
+
const paths = spec.paths ?? {};
|
|
78
|
+
for (const [path, pathItem] of Object.entries(paths)) {
|
|
79
|
+
if (!pathItem)
|
|
80
|
+
continue;
|
|
81
|
+
for (const [rawMethod, operation] of Object.entries(pathItem)) {
|
|
82
|
+
if (rawMethod.startsWith('x-') || rawMethod === 'parameters' || !operation)
|
|
83
|
+
continue;
|
|
84
|
+
const method = rawMethod.toUpperCase();
|
|
85
|
+
if (!['GET', 'POST', 'PUT', 'DELETE', 'PATCH', 'HEAD', 'OPTIONS'].includes(method))
|
|
86
|
+
continue;
|
|
87
|
+
const current = hashEndpointSpec(path, method, operation);
|
|
88
|
+
const registryKey = `${method} ${path}`;
|
|
89
|
+
const previousHash = registry[registryKey];
|
|
90
|
+
if (previousHash === current.specHash) {
|
|
91
|
+
skipped.push(registryKey);
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
toValidate.push(current);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
return { toValidate, skipped };
|
|
99
|
+
}
|
|
100
|
+
// ---------------------------------------------------------------------------
|
|
101
|
+
// Schema validation (reuses the shape proven by engine agent #39)
|
|
102
|
+
// ---------------------------------------------------------------------------
|
|
103
|
+
/**
|
|
104
|
+
* Validate a response body against a JSON schema fragment (OpenAPI 3 subset).
|
|
105
|
+
* Pure and deterministic — no I/O. Engine agent #39 validates live HTTP; this layer validates
|
|
106
|
+
* engine-provided body snapshots and sampled traffic records.
|
|
107
|
+
*
|
|
108
|
+
* Never rounds up: every violation is reported individually with field-path precision.
|
|
109
|
+
*/
|
|
110
|
+
export function validateResponseSchema(body, schema, endpointLabel, statusCode) {
|
|
111
|
+
const violations = [];
|
|
112
|
+
collectSchemaViolations(body, schema, '$', violations);
|
|
113
|
+
return {
|
|
114
|
+
endpoint: endpointLabel,
|
|
115
|
+
statusCode,
|
|
116
|
+
violations,
|
|
117
|
+
conformant: violations.length === 0,
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
function collectSchemaViolations(value, schema, path, out) {
|
|
121
|
+
// Infer the type when omitted: a schema with `properties` is an object and one with
|
|
122
|
+
// `items` is an array (OpenAPI allows the implicit form). Without this, a typeless
|
|
123
|
+
// schema validated NOTHING and silently passed (fail-open, NEW-3).
|
|
124
|
+
const effectiveType = schema.type ??
|
|
125
|
+
(schema.properties !== undefined ? 'object' : schema.items !== undefined ? 'array' : undefined);
|
|
126
|
+
if (effectiveType === 'object') {
|
|
127
|
+
if (typeof value !== 'object' || value === null || Array.isArray(value)) {
|
|
128
|
+
out.push({ fieldPath: path, expected: 'object', actual: describeType(value) });
|
|
129
|
+
return;
|
|
130
|
+
}
|
|
131
|
+
const record = value;
|
|
132
|
+
// Required-field presence check
|
|
133
|
+
for (const field of schema.required ?? []) {
|
|
134
|
+
if (!(field in record)) {
|
|
135
|
+
out.push({
|
|
136
|
+
fieldPath: `${path}.${field}`,
|
|
137
|
+
expected: `required field present`,
|
|
138
|
+
actual: 'missing',
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
// Recursive property type checks
|
|
143
|
+
for (const [field, fieldSchema] of Object.entries(schema.properties ?? {})) {
|
|
144
|
+
if (field in record) {
|
|
145
|
+
collectSchemaViolations(record[field], fieldSchema, `${path}.${field}`, out);
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
// Enum check at object level (unusual but spec-legal)
|
|
149
|
+
if (schema.enum !== undefined && !schema.enum.includes(value)) {
|
|
150
|
+
out.push({
|
|
151
|
+
fieldPath: path,
|
|
152
|
+
expected: `one of [${schema.enum.map((v) => JSON.stringify(v)).join(', ')}]`,
|
|
153
|
+
actual: JSON.stringify(value),
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
else if (effectiveType === 'array') {
|
|
158
|
+
if (!Array.isArray(value)) {
|
|
159
|
+
out.push({ fieldPath: path, expected: 'array', actual: describeType(value) });
|
|
160
|
+
return;
|
|
161
|
+
}
|
|
162
|
+
if (schema.items) {
|
|
163
|
+
for (let i = 0; i < value.length; i++) {
|
|
164
|
+
collectSchemaViolations(value[i], schema.items, `${path}[${i}]`, out);
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
else if (effectiveType !== undefined) {
|
|
169
|
+
const jsType = jsTypeForSchemaType(effectiveType);
|
|
170
|
+
const actual = describeType(value);
|
|
171
|
+
// Must-fix #6: null is NOT a valid value when the schema declares a specific type.
|
|
172
|
+
// Remove the `&& value !== null` guard — null bypasses the type check otherwise.
|
|
173
|
+
if (actual !== jsType) {
|
|
174
|
+
out.push({ fieldPath: path, expected: jsType, actual });
|
|
175
|
+
}
|
|
176
|
+
// Enum check on scalar
|
|
177
|
+
if (schema.enum !== undefined && !schema.enum.includes(value)) {
|
|
178
|
+
out.push({
|
|
179
|
+
fieldPath: path,
|
|
180
|
+
expected: `one of [${schema.enum.map((v) => JSON.stringify(v)).join(', ')}]`,
|
|
181
|
+
actual: JSON.stringify(value),
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
function jsTypeForSchemaType(schemaType) {
|
|
187
|
+
if (schemaType === 'integer')
|
|
188
|
+
return 'number';
|
|
189
|
+
return schemaType; // string, boolean, number, object, array
|
|
190
|
+
}
|
|
191
|
+
function describeType(v) {
|
|
192
|
+
if (v === null)
|
|
193
|
+
return 'null';
|
|
194
|
+
if (Array.isArray(v))
|
|
195
|
+
return 'array';
|
|
196
|
+
return typeof v;
|
|
197
|
+
}
|
|
198
|
+
// ---------------------------------------------------------------------------
|
|
199
|
+
// Breaking-change detection (spec diff, improvement #3/#7 of the 10)
|
|
200
|
+
// ---------------------------------------------------------------------------
|
|
201
|
+
/**
|
|
202
|
+
* Diff two OpenAPI specs and classify each change as breaking or additive.
|
|
203
|
+
* Breaking changes on stable APIs carry decision === 'block'; unstable/experimental carry 'warn'.
|
|
204
|
+
*
|
|
205
|
+
* Show-the-math: every change is individually listed with its kind, path, and decision.
|
|
206
|
+
* Never gameable: block/warn is derived deterministically from the kind + stability pair.
|
|
207
|
+
*/
|
|
208
|
+
export function detectBreakingChanges(previousSpec, currentSpec) {
|
|
209
|
+
const changes = [];
|
|
210
|
+
const additivePaths = [];
|
|
211
|
+
const prevPaths = previousSpec.paths ?? {};
|
|
212
|
+
const currPaths = currentSpec.paths ?? {};
|
|
213
|
+
// Detect removed endpoints
|
|
214
|
+
for (const [path, prevItem] of Object.entries(prevPaths)) {
|
|
215
|
+
if (!currPaths[path]) {
|
|
216
|
+
const stability = inferStability(prevItem?.['get']);
|
|
217
|
+
changes.push(makeBreakingChange('endpoint-removed', path, '*', `Endpoint ${path} was removed`, stability));
|
|
218
|
+
continue;
|
|
219
|
+
}
|
|
220
|
+
const currItem = currPaths[path];
|
|
221
|
+
// Diff per method
|
|
222
|
+
for (const [rawMethod, prevOp] of Object.entries(prevItem ?? {})) {
|
|
223
|
+
if (rawMethod.startsWith('x-') || rawMethod === 'parameters' || !prevOp)
|
|
224
|
+
continue;
|
|
225
|
+
const method = rawMethod.toUpperCase();
|
|
226
|
+
const currOp = currItem[rawMethod];
|
|
227
|
+
const stability = inferStability(prevOp);
|
|
228
|
+
if (!currOp) {
|
|
229
|
+
changes.push(makeBreakingChange('endpoint-removed', path, method, `${method} ${path} was removed`, stability));
|
|
230
|
+
continue;
|
|
231
|
+
}
|
|
232
|
+
// Diff response schemas
|
|
233
|
+
const prevResponses = prevOp.responses ?? {};
|
|
234
|
+
const currResponses = currOp.responses ?? {};
|
|
235
|
+
// Status code removal
|
|
236
|
+
for (const statusCode of Object.keys(prevResponses)) {
|
|
237
|
+
if (!currResponses[statusCode]) {
|
|
238
|
+
changes.push(makeBreakingChange('status-code-removed', path, method, `Status ${statusCode} removed from ${method} ${path}`, stability));
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
// Schema field diffs on the primary success response
|
|
242
|
+
const prevSchema = extractPrimarySchema(prevResponses);
|
|
243
|
+
const currSchema = extractPrimarySchema(currResponses);
|
|
244
|
+
if (prevSchema && currSchema) {
|
|
245
|
+
diffSchemas(path, method, prevSchema, currSchema, stability, changes, additivePaths);
|
|
246
|
+
}
|
|
247
|
+
// Must-fix #4: Diff requestBody required fields and parameters.
|
|
248
|
+
// Adding a new required request field breaks old callers that don't send it.
|
|
249
|
+
diffRequestBody(path, method, prevOp.requestBody, currOp.requestBody, stability, changes);
|
|
250
|
+
diffParameters(path, method, prevOp.parameters ?? [], currOp.parameters ?? [], stability, changes);
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
// Detect added endpoints (additive, non-breaking)
|
|
254
|
+
for (const path of Object.keys(currPaths)) {
|
|
255
|
+
if (!prevPaths[path]) {
|
|
256
|
+
additivePaths.push(path);
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
const shouldBlockRelease = changes.some((c) => c.decision === 'block');
|
|
260
|
+
return { changes, additivePaths, shouldBlockRelease };
|
|
261
|
+
}
|
|
262
|
+
function inferStability(op) {
|
|
263
|
+
return op?.['x-stability'] ?? 'stable';
|
|
264
|
+
}
|
|
265
|
+
function decisionForStability(stability) {
|
|
266
|
+
return stability === 'stable' ? 'block' : 'warn';
|
|
267
|
+
}
|
|
268
|
+
function makeBreakingChange(kind, path, method, description, stability) {
|
|
269
|
+
return { kind, path, method, description, stability, decision: decisionForStability(stability) };
|
|
270
|
+
}
|
|
271
|
+
function extractPrimarySchema(responses) {
|
|
272
|
+
// Scan ALL 2xx success codes (sorted for determinism), not just 200/201/202, so a
|
|
273
|
+
// 203/206/etc. success body is not invisible to breaking-change + mock generation (NEW-6).
|
|
274
|
+
const successCodes = Object.keys(responses)
|
|
275
|
+
.filter((c) => /^2\d\d$/.test(c))
|
|
276
|
+
.sort();
|
|
277
|
+
for (const code of successCodes) {
|
|
278
|
+
const schema = responses[code]?.content?.['application/json']?.schema;
|
|
279
|
+
if (schema)
|
|
280
|
+
return schema;
|
|
281
|
+
}
|
|
282
|
+
return null;
|
|
283
|
+
}
|
|
284
|
+
/** Max nesting depth for the recursive schema diff (defensive against circular schemas). */
|
|
285
|
+
const MAX_SCHEMA_DIFF_DEPTH = 64;
|
|
286
|
+
function diffSchemas(path, method, prev, curr, stability, breaking, additive, fieldPrefix = '', depth = 0) {
|
|
287
|
+
// Defensive: real OpenAPI schemas are shallow; bail on pathological depth so a
|
|
288
|
+
// $ref-resolved circular schema cannot overflow the stack.
|
|
289
|
+
if (depth > MAX_SCHEMA_DIFF_DEPTH)
|
|
290
|
+
return;
|
|
291
|
+
const at = fieldPrefix === '' ? 'root' : `"${fieldPrefix}"`;
|
|
292
|
+
if (prev.type !== curr.type && prev.type !== undefined && curr.type !== undefined) {
|
|
293
|
+
breaking.push(makeBreakingChange('field-type-changed', path, method, `${method} ${path}: ${at} type changed from ${prev.type} to ${curr.type}`, stability));
|
|
294
|
+
}
|
|
295
|
+
const prevProps = prev.properties ?? {};
|
|
296
|
+
const currProps = curr.properties ?? {};
|
|
297
|
+
const prevRequired = new Set(prev.required ?? []);
|
|
298
|
+
for (const field of Object.keys(prevProps)) {
|
|
299
|
+
const fieldLabel = fieldPrefix === '' ? field : `${fieldPrefix}.${field}`;
|
|
300
|
+
if (!currProps[field]) {
|
|
301
|
+
if (prevRequired.has(field)) {
|
|
302
|
+
breaking.push(makeBreakingChange('field-removed', path, method, `${method} ${path}: required field "${fieldLabel}" removed from response`, stability));
|
|
303
|
+
}
|
|
304
|
+
// Non-required fields removed: additive, not breaking.
|
|
305
|
+
}
|
|
306
|
+
else {
|
|
307
|
+
const pf = prevProps[field];
|
|
308
|
+
const cf = currProps[field];
|
|
309
|
+
if (pf && cf) {
|
|
310
|
+
if (pf.type && cf.type && pf.type !== cf.type) {
|
|
311
|
+
breaking.push(makeBreakingChange('field-type-changed', path, method, `${method} ${path}: field "${fieldLabel}" type changed from ${pf.type} to ${cf.type}`, stability));
|
|
312
|
+
}
|
|
313
|
+
if (pf.enum && cf.enum) {
|
|
314
|
+
for (const val of pf.enum) {
|
|
315
|
+
if (!cf.enum.includes(val)) {
|
|
316
|
+
breaking.push(makeBreakingChange('enum-value-removed', path, method, `${method} ${path}: enum value ${JSON.stringify(val)} removed from field "${fieldLabel}"`, stability));
|
|
317
|
+
}
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
// RECURSE into nested object properties (NEW-1): a nested required-field removal
|
|
321
|
+
// or nested type change is breaking and the top-level scan alone would miss it.
|
|
322
|
+
if ((pf.properties !== undefined || pf.type === 'object') &&
|
|
323
|
+
(cf.properties !== undefined || cf.type === 'object')) {
|
|
324
|
+
diffSchemas(path, method, pf, cf, stability, breaking, additive, fieldLabel, depth + 1);
|
|
325
|
+
}
|
|
326
|
+
// RECURSE into array item schemas.
|
|
327
|
+
if (pf.items !== undefined && cf.items !== undefined) {
|
|
328
|
+
diffSchemas(path, method, pf.items, cf.items, stability, breaking, additive, `${fieldLabel}[]`, depth + 1);
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
}
|
|
332
|
+
}
|
|
333
|
+
for (const field of Object.keys(currProps)) {
|
|
334
|
+
if (!prevProps[field]) {
|
|
335
|
+
const fieldLabel = fieldPrefix === '' ? field : `${fieldPrefix}.${field}`;
|
|
336
|
+
additive.push(`${method} ${path}#${fieldLabel}`);
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
}
|
|
340
|
+
/**
|
|
341
|
+
* Must-fix #4: Diff requestBody required fields.
|
|
342
|
+
* A new required field in the current requestBody schema breaks old callers that
|
|
343
|
+
* do not send it. This was previously dead — it only looked at RESPONSE schemas.
|
|
344
|
+
*/
|
|
345
|
+
function diffRequestBody(path, method, prevBody, currBody, stability, breaking) {
|
|
346
|
+
// Extract the JSON schema from the requestBody content
|
|
347
|
+
const prevSchema = prevBody?.content?.['application/json']?.schema;
|
|
348
|
+
const currSchema = currBody?.content?.['application/json']?.schema;
|
|
349
|
+
if (!currSchema)
|
|
350
|
+
return; // Nothing to enforce on the current side
|
|
351
|
+
const prevRequired = new Set(prevSchema?.required ?? []);
|
|
352
|
+
const currRequired = new Set(currSchema?.required ?? []);
|
|
353
|
+
for (const field of currRequired) {
|
|
354
|
+
if (!prevRequired.has(field)) {
|
|
355
|
+
// New required field in the request body — old callers that omit it will fail
|
|
356
|
+
breaking.push(makeBreakingChange('required-added', path, method, `${method} ${path}: new required request body field "${field}" (old callers will fail)`, stability));
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
}
|
|
360
|
+
/**
|
|
361
|
+
* Must-fix #4: Diff path/query parameters for newly required parameters.
|
|
362
|
+
* Adding a required parameter where none existed (or it was optional) breaks old callers.
|
|
363
|
+
*/
|
|
364
|
+
function diffParameters(path, method, prevParams, currParams, stability, breaking) {
|
|
365
|
+
const prevByName = new Map(prevParams.map((p) => [p.name, p]));
|
|
366
|
+
for (const currParam of currParams) {
|
|
367
|
+
if (!currParam.required)
|
|
368
|
+
continue; // optional params added are non-breaking
|
|
369
|
+
const prevParam = prevByName.get(currParam.name);
|
|
370
|
+
if (!prevParam) {
|
|
371
|
+
// Entirely new required parameter
|
|
372
|
+
breaking.push(makeBreakingChange('required-added', path, method, `${method} ${path}: new required parameter "${currParam.name}" in ${currParam.in} (old callers will fail)`, stability));
|
|
373
|
+
}
|
|
374
|
+
else if (!prevParam.required) {
|
|
375
|
+
// Was optional, now required
|
|
376
|
+
breaking.push(makeBreakingChange('required-added', path, method, `${method} ${path}: parameter "${currParam.name}" in ${currParam.in} changed from optional to required (old callers will fail)`, stability));
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
// ---------------------------------------------------------------------------
|
|
381
|
+
// Consumer-driven contracts (Pact — improvement #6)
|
|
382
|
+
// ---------------------------------------------------------------------------
|
|
383
|
+
/**
|
|
384
|
+
* Verify a provider against one consumer Pact contract by checking each interaction against
|
|
385
|
+
* the fixture responses returned by the provider fixture function.
|
|
386
|
+
*
|
|
387
|
+
* `providerFixture` is the adapter that the caller provides — it replays an interaction against
|
|
388
|
+
* the actual provider (staging) or a recorded fixture. Pure composition: this layer classifies;
|
|
389
|
+
* the caller owns I/O.
|
|
390
|
+
*/
|
|
391
|
+
export async function verifyPactContract(contract, providerFixture) {
|
|
392
|
+
const results = [];
|
|
393
|
+
for (const interaction of contract.interactions) {
|
|
394
|
+
let result;
|
|
395
|
+
try {
|
|
396
|
+
const actual = await providerFixture(interaction);
|
|
397
|
+
const statusMatches = actual.statusCode === interaction.response.status;
|
|
398
|
+
// If the interaction specifies a response body, validate it structurally
|
|
399
|
+
let bodyMatches = true;
|
|
400
|
+
let failureReason;
|
|
401
|
+
if (!statusMatches) {
|
|
402
|
+
bodyMatches = false;
|
|
403
|
+
failureReason = `expected status ${interaction.response.status}, got ${actual.statusCode}`;
|
|
404
|
+
}
|
|
405
|
+
else if (interaction.response.body !== undefined) {
|
|
406
|
+
const match = deepStructuralMatch(actual.body, interaction.response.body);
|
|
407
|
+
bodyMatches = match.matched;
|
|
408
|
+
failureReason = match.matched ? undefined : match.reason;
|
|
409
|
+
}
|
|
410
|
+
result = {
|
|
411
|
+
consumer: contract.consumer.name,
|
|
412
|
+
provider: contract.provider.name,
|
|
413
|
+
interaction: interaction.description,
|
|
414
|
+
passed: statusMatches && bodyMatches,
|
|
415
|
+
...(failureReason !== undefined ? { failureReason } : {}),
|
|
416
|
+
};
|
|
417
|
+
}
|
|
418
|
+
catch (err) {
|
|
419
|
+
result = {
|
|
420
|
+
consumer: contract.consumer.name,
|
|
421
|
+
provider: contract.provider.name,
|
|
422
|
+
interaction: interaction.description,
|
|
423
|
+
passed: false,
|
|
424
|
+
failureReason: err instanceof Error ? err.message : String(err),
|
|
425
|
+
};
|
|
426
|
+
}
|
|
427
|
+
results.push(result);
|
|
428
|
+
}
|
|
429
|
+
return results;
|
|
430
|
+
}
|
|
431
|
+
/**
|
|
432
|
+
* Build a blast-radius map: which consumers have failing interactions, and how many total.
|
|
433
|
+
* Show-the-math: lists every consumer and every failing interaction by name.
|
|
434
|
+
*/
|
|
435
|
+
export function buildBlastRadiusMap(verifications) {
|
|
436
|
+
const byConsumer = new Map();
|
|
437
|
+
for (const v of verifications) {
|
|
438
|
+
if (!v.passed) {
|
|
439
|
+
const existing = byConsumer.get(v.consumer) ?? [];
|
|
440
|
+
existing.push(v.interaction);
|
|
441
|
+
byConsumer.set(v.consumer, existing);
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
const brokenConsumers = [...byConsumer.entries()].map(([consumer, failingInteractions]) => ({
|
|
445
|
+
consumer,
|
|
446
|
+
failingInteractions,
|
|
447
|
+
}));
|
|
448
|
+
return { brokenConsumers, totalAffectedConsumers: brokenConsumers.length };
|
|
449
|
+
}
|
|
450
|
+
/**
|
|
451
|
+
* Structural deep equality check: actual must contain at least all fields present in expected.
|
|
452
|
+
*
|
|
453
|
+
* Null semantics (must-fix #5):
|
|
454
|
+
* expected === null → actual MUST be null (fail-closed; provider omitting a null field fails)
|
|
455
|
+
* expected === undefined → skip (field not specified by consumer; any actual value is fine)
|
|
456
|
+
*/
|
|
457
|
+
function deepStructuralMatch(actual, expected) {
|
|
458
|
+
if (expected === undefined) {
|
|
459
|
+
// Consumer didn't specify this field — any actual value accepted
|
|
460
|
+
return { matched: true };
|
|
461
|
+
}
|
|
462
|
+
if (expected === null) {
|
|
463
|
+
// Consumer explicitly expects null — provider must also return null
|
|
464
|
+
if (actual !== null) {
|
|
465
|
+
return { matched: false, reason: `expected null, got ${describeType(actual)}` };
|
|
466
|
+
}
|
|
467
|
+
return { matched: true };
|
|
468
|
+
}
|
|
469
|
+
if (typeof expected !== typeof actual) {
|
|
470
|
+
return { matched: false, reason: `type mismatch: expected ${typeof expected}, got ${typeof actual}` };
|
|
471
|
+
}
|
|
472
|
+
if (typeof expected === 'object' && !Array.isArray(expected)) {
|
|
473
|
+
const expObj = expected;
|
|
474
|
+
const actObj = actual;
|
|
475
|
+
for (const key of Object.keys(expObj)) {
|
|
476
|
+
if (!(key in actObj)) {
|
|
477
|
+
return { matched: false, reason: `missing field "${key}"` };
|
|
478
|
+
}
|
|
479
|
+
const nested = deepStructuralMatch(actObj[key], expObj[key]);
|
|
480
|
+
if (!nested.matched) {
|
|
481
|
+
return { matched: false, reason: `field "${key}": ${nested.reason}` };
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
return { matched: true };
|
|
485
|
+
}
|
|
486
|
+
if (Array.isArray(expected)) {
|
|
487
|
+
if (!Array.isArray(actual)) {
|
|
488
|
+
return { matched: false, reason: `expected array, got ${typeof actual}` };
|
|
489
|
+
}
|
|
490
|
+
for (let i = 0; i < expected.length; i++) {
|
|
491
|
+
const nested = deepStructuralMatch(actual[i], expected[i]);
|
|
492
|
+
if (!nested.matched) {
|
|
493
|
+
return { matched: false, reason: `index ${i}: ${nested.reason}` };
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
return { matched: true };
|
|
497
|
+
}
|
|
498
|
+
if (expected !== actual) {
|
|
499
|
+
return { matched: false, reason: `expected ${JSON.stringify(expected)}, got ${JSON.stringify(actual)}` };
|
|
500
|
+
}
|
|
501
|
+
return { matched: true };
|
|
502
|
+
}
|
|
503
|
+
// ---------------------------------------------------------------------------
|
|
504
|
+
// Runtime contract monitoring (improvement #8 — sampled prod traffic)
|
|
505
|
+
// ---------------------------------------------------------------------------
|
|
506
|
+
/**
|
|
507
|
+
* Validate a set of sampled production traffic records against the spec.
|
|
508
|
+
* Frugal by design: callers control the sample size; we only classify what we receive.
|
|
509
|
+
* Latency / SLA contract: also checks response-time budget per endpoint.
|
|
510
|
+
*/
|
|
511
|
+
export function validateRuntimeSample(records, spec) {
|
|
512
|
+
const violations = [];
|
|
513
|
+
for (const record of records) {
|
|
514
|
+
const [method = '', ...pathParts] = record.endpoint.split(' ');
|
|
515
|
+
const path = pathParts.join(' ');
|
|
516
|
+
const pathItem = spec.paths?.[path];
|
|
517
|
+
const operation = pathItem?.[method.toLowerCase()];
|
|
518
|
+
// FAIL-CLOSED (NEW-2): an endpoint absent from the spec is an UNKNOWN/undocumented
|
|
519
|
+
// surface — flag it rather than silently passing it as conformant.
|
|
520
|
+
if (operation === undefined) {
|
|
521
|
+
violations.push({
|
|
522
|
+
record,
|
|
523
|
+
violations: [{
|
|
524
|
+
fieldPath: '$',
|
|
525
|
+
expected: 'a documented endpoint in the spec',
|
|
526
|
+
actual: `unknown endpoint "${record.endpoint}"`,
|
|
527
|
+
}],
|
|
528
|
+
latencyViolated: false,
|
|
529
|
+
});
|
|
530
|
+
continue;
|
|
531
|
+
}
|
|
532
|
+
const schemaForStatus = operation.responses?.[String(record.statusCode)]?.content?.['application/json']?.schema;
|
|
533
|
+
const schemaViolations = [];
|
|
534
|
+
if (schemaForStatus) {
|
|
535
|
+
collectSchemaViolations(record.responseBodyJson, schemaForStatus, '$', schemaViolations);
|
|
536
|
+
}
|
|
537
|
+
const budgetMs = operation['x-latency-budget-ms'];
|
|
538
|
+
const latencyViolated = budgetMs !== undefined && record.latencyMs > budgetMs;
|
|
539
|
+
if (schemaViolations.length > 0 || latencyViolated) {
|
|
540
|
+
violations.push({
|
|
541
|
+
record,
|
|
542
|
+
violations: schemaViolations,
|
|
543
|
+
latencyViolated,
|
|
544
|
+
...(budgetMs !== undefined ? { budgetMs } : {}),
|
|
545
|
+
});
|
|
546
|
+
}
|
|
547
|
+
}
|
|
548
|
+
return {
|
|
549
|
+
sampledCount: records.length,
|
|
550
|
+
violationCount: violations.length,
|
|
551
|
+
violations,
|
|
552
|
+
};
|
|
553
|
+
}
|
|
554
|
+
// ---------------------------------------------------------------------------
|
|
555
|
+
// Error-response contract validation (core capability)
|
|
556
|
+
// ---------------------------------------------------------------------------
|
|
557
|
+
/**
|
|
558
|
+
* Validate that an error response body contains all fields declared in the error contract spec.
|
|
559
|
+
* Error-contract conformance is a first-class contract, not an afterthought.
|
|
560
|
+
*/
|
|
561
|
+
export function validateErrorContract(endpoint, statusCode, responseBody, errorSpec) {
|
|
562
|
+
const missingFields = [];
|
|
563
|
+
if (typeof responseBody === 'object' && responseBody !== null && !Array.isArray(responseBody)) {
|
|
564
|
+
const record = responseBody;
|
|
565
|
+
for (const field of errorSpec.requiredFields) {
|
|
566
|
+
if (!(field in record)) {
|
|
567
|
+
missingFields.push(field);
|
|
568
|
+
}
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
else {
|
|
572
|
+
// Body is not an object at all — all required fields are "missing"
|
|
573
|
+
missingFields.push(...errorSpec.requiredFields);
|
|
574
|
+
}
|
|
575
|
+
return {
|
|
576
|
+
endpoint,
|
|
577
|
+
statusCode,
|
|
578
|
+
conformant: missingFields.length === 0,
|
|
579
|
+
missingFields,
|
|
580
|
+
};
|
|
581
|
+
}
|
|
582
|
+
// ---------------------------------------------------------------------------
|
|
583
|
+
// Mock generation (improvement #10 — self-healing mocks via msw)
|
|
584
|
+
// ---------------------------------------------------------------------------
|
|
585
|
+
/**
|
|
586
|
+
* Generate msw (Mock Service Worker) handler code from an OpenAPI spec.
|
|
587
|
+
* The generated handlers are derived from the spec's example / schema defaults so they are
|
|
588
|
+
* always in sync — "self-healing mocks". Callers write the returned code to their test fixtures.
|
|
589
|
+
*
|
|
590
|
+
* Pure and deterministic: same spec → same handler code.
|
|
591
|
+
*/
|
|
592
|
+
export function generateMockHandlers(spec) {
|
|
593
|
+
const handlers = [];
|
|
594
|
+
const paths = spec.paths ?? {};
|
|
595
|
+
for (const [path, pathItem] of Object.entries(paths)) {
|
|
596
|
+
if (!pathItem)
|
|
597
|
+
continue;
|
|
598
|
+
for (const [rawMethod, operation] of Object.entries(pathItem)) {
|
|
599
|
+
if (rawMethod.startsWith('x-') || rawMethod === 'parameters' || !operation)
|
|
600
|
+
continue;
|
|
601
|
+
const method = rawMethod.toLowerCase();
|
|
602
|
+
const op = operation;
|
|
603
|
+
const schema = extractPrimarySchema(op.responses ?? {});
|
|
604
|
+
const exampleBody = schema ? schemaToExample(schema) : null;
|
|
605
|
+
const endpointLabel = `${rawMethod.toUpperCase()} ${path}`;
|
|
606
|
+
// Convert OpenAPI path params ("{id}") to msw URL pattern (":id")
|
|
607
|
+
const mswPath = path.replace(/\{(\w+)\}/g, ':$1');
|
|
608
|
+
const handlerCode = [
|
|
609
|
+
`http.${method}('${mswPath}', () => {`,
|
|
610
|
+
` return HttpResponse.json(${JSON.stringify(exampleBody, null, 2)}, { status: 200 });`,
|
|
611
|
+
`}),`,
|
|
612
|
+
].join('\n');
|
|
613
|
+
handlers.push({ endpoint: endpointLabel, handlerCode });
|
|
614
|
+
}
|
|
615
|
+
}
|
|
616
|
+
return handlers;
|
|
617
|
+
}
|
|
618
|
+
/** Derive a minimal example object from a JSON schema fragment. */
|
|
619
|
+
function schemaToExample(schema) {
|
|
620
|
+
switch (schema.type) {
|
|
621
|
+
case 'object': {
|
|
622
|
+
const obj = {};
|
|
623
|
+
for (const [field, fieldSchema] of Object.entries(schema.properties ?? {})) {
|
|
624
|
+
obj[field] = schemaToExample(fieldSchema);
|
|
625
|
+
}
|
|
626
|
+
return obj;
|
|
627
|
+
}
|
|
628
|
+
case 'array':
|
|
629
|
+
return schema.items ? [schemaToExample(schema.items)] : [];
|
|
630
|
+
case 'string':
|
|
631
|
+
if (schema.enum && schema.enum.length > 0)
|
|
632
|
+
return schema.enum[0];
|
|
633
|
+
if (schema.format === 'date-time')
|
|
634
|
+
return '2024-01-01T00:00:00.000Z';
|
|
635
|
+
if (schema.format === 'uuid')
|
|
636
|
+
return '00000000-0000-0000-0000-000000000000';
|
|
637
|
+
return 'string';
|
|
638
|
+
case 'integer':
|
|
639
|
+
case 'number':
|
|
640
|
+
return 0;
|
|
641
|
+
case 'boolean':
|
|
642
|
+
return false;
|
|
643
|
+
default:
|
|
644
|
+
return null;
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
// ---------------------------------------------------------------------------
|
|
648
|
+
// Migration guide authoring (improvement #9)
|
|
649
|
+
// ---------------------------------------------------------------------------
|
|
650
|
+
/**
|
|
651
|
+
* Auto-draft a migration guide for every breaking change in a diff.
|
|
652
|
+
* Handed to Documentation Sync (#10) — this layer author's the draft; humans refine it.
|
|
653
|
+
* Show-the-math: every change gets its own entry with before/after examples.
|
|
654
|
+
*/
|
|
655
|
+
export function draftMigrationGuide(diff, options) {
|
|
656
|
+
if (diff.changes.length === 0)
|
|
657
|
+
return null;
|
|
658
|
+
const now = options?.clock ? new Date(options.clock()).toISOString() : new Date().toISOString();
|
|
659
|
+
const entries = diff.changes.map((change) => {
|
|
660
|
+
const { recommendation, exampleBefore, exampleAfter } = migrationAdvice(change);
|
|
661
|
+
return { change, recommendation, exampleBefore, exampleAfter };
|
|
662
|
+
});
|
|
663
|
+
return {
|
|
664
|
+
title: `API Breaking-Change Migration Guide — ${diff.changes.length} change(s)`,
|
|
665
|
+
generatedAt: now,
|
|
666
|
+
entries,
|
|
667
|
+
};
|
|
668
|
+
}
|
|
669
|
+
function migrationAdvice(change) {
|
|
670
|
+
switch (change.kind) {
|
|
671
|
+
case 'field-removed':
|
|
672
|
+
return {
|
|
673
|
+
recommendation: `Add the removed field back or introduce a new versioned endpoint. Bump the major version if on a stable API.`,
|
|
674
|
+
exampleBefore: `// Response included "${change.path}" field`,
|
|
675
|
+
exampleAfter: `// Field removed — update consumers to not rely on it, or restore it under a new version`,
|
|
676
|
+
};
|
|
677
|
+
case 'field-type-changed':
|
|
678
|
+
return {
|
|
679
|
+
recommendation: `Restore the original type or introduce a new field with the new type, keeping the old field. Bump the major version if on a stable API.`,
|
|
680
|
+
exampleBefore: `// ${change.description.split(':')[1]?.trim() ?? change.description}`,
|
|
681
|
+
exampleAfter: `// Add new typed field alongside the original; deprecate the original`,
|
|
682
|
+
};
|
|
683
|
+
case 'enum-value-removed':
|
|
684
|
+
return {
|
|
685
|
+
recommendation: `Restore the removed enum value, or verify no consumer depends on it via the blast-radius map.`,
|
|
686
|
+
exampleBefore: `// Enum included the removed value`,
|
|
687
|
+
exampleAfter: `// Value removed — consumers relying on it will error`,
|
|
688
|
+
};
|
|
689
|
+
case 'endpoint-removed':
|
|
690
|
+
return {
|
|
691
|
+
recommendation: `Restore the endpoint or add a forwarding redirect to the replacement. Announce sunset in advance.`,
|
|
692
|
+
exampleBefore: `// Endpoint ${change.path} existed`,
|
|
693
|
+
exampleAfter: `// Endpoint removed — consumers will receive 404`,
|
|
694
|
+
};
|
|
695
|
+
case 'status-code-removed':
|
|
696
|
+
return {
|
|
697
|
+
recommendation: `Restore the removed status code to the spec, or document the new error handling path clearly.`,
|
|
698
|
+
exampleBefore: `// ${change.method} ${change.path} declared the removed status code`,
|
|
699
|
+
exampleAfter: `// Status code removed from spec — consumers handling it need updating`,
|
|
700
|
+
};
|
|
701
|
+
case 'required-added':
|
|
702
|
+
return {
|
|
703
|
+
recommendation: `Remove the new required field or give it a default so old callers are not broken. Version bump required.`,
|
|
704
|
+
exampleBefore: `// Request did not include the now-required field`,
|
|
705
|
+
exampleAfter: `// Old callers will fail validation — add a default or make the field optional`,
|
|
706
|
+
};
|
|
707
|
+
default: {
|
|
708
|
+
// exhaustive guard — change satisfies never at compile time after all cases are handled
|
|
709
|
+
const _exhaustive = change.kind;
|
|
710
|
+
return {
|
|
711
|
+
recommendation: `Review the change manually: ${_exhaustive}`,
|
|
712
|
+
exampleBefore: '',
|
|
713
|
+
exampleAfter: '',
|
|
714
|
+
};
|
|
715
|
+
}
|
|
716
|
+
}
|
|
717
|
+
}
|
|
718
|
+
/**
|
|
719
|
+
* Run the full API contract validation pipeline.
|
|
720
|
+
* Composes: spec-hash gating → schema validation → breaking-change detection →
|
|
721
|
+
* Pact consumer verification → blast-radius mapping → error contract → runtime sample →
|
|
722
|
+
* mock generation → migration guide.
|
|
723
|
+
*
|
|
724
|
+
* Never mutates the API. Never throws on validation failures — failures are reported as findings
|
|
725
|
+
* in the returned report. Only infrastructure errors (bad spec JSON, etc.) propagate.
|
|
726
|
+
*/
|
|
727
|
+
export async function validateApiContract(opts) {
|
|
728
|
+
// 1. Spec-hash diff gating: determine which endpoints need re-validation.
|
|
729
|
+
const { toValidate, skipped } = partitionByHash(opts.currentSpec, opts.hashRegistry);
|
|
730
|
+
const toValidateKeys = new Set(toValidate.map((h) => `${h.method} ${h.path}`));
|
|
731
|
+
// 2. Schema validation: only on endpoints whose hash changed.
|
|
732
|
+
const schemaResults = [];
|
|
733
|
+
for (const [endpointKey, snapshot] of Object.entries(opts.endpointSnapshots)) {
|
|
734
|
+
const [method = '', ...pathParts] = endpointKey.split(' ');
|
|
735
|
+
const path = pathParts.join(' ');
|
|
736
|
+
const pathItem = opts.currentSpec.paths?.[path];
|
|
737
|
+
const operation = pathItem?.[method.toLowerCase()];
|
|
738
|
+
// FAIL-CLOSED: a snapshot for an endpoint absent from the spec is a typo or an
|
|
739
|
+
// undocumented endpoint — flag it rather than silently skipping it.
|
|
740
|
+
if (operation === undefined) {
|
|
741
|
+
schemaResults.push({
|
|
742
|
+
endpoint: endpointKey,
|
|
743
|
+
statusCode: snapshot.statusCode,
|
|
744
|
+
violations: [{ fieldPath: '$', expected: 'a documented endpoint in the spec', actual: `unknown endpoint "${endpointKey}"` }],
|
|
745
|
+
conformant: false,
|
|
746
|
+
});
|
|
747
|
+
continue;
|
|
748
|
+
}
|
|
749
|
+
if (!toValidateKeys.has(endpointKey)) {
|
|
750
|
+
// spec-hash gate: spec unchanged → skip schema re-validation (not a conformance proof)
|
|
751
|
+
continue;
|
|
752
|
+
}
|
|
753
|
+
const schema = operation.responses?.[String(snapshot.statusCode)]?.content?.['application/json']?.schema;
|
|
754
|
+
if (schema) {
|
|
755
|
+
schemaResults.push(validateResponseSchema(snapshot.body, schema, endpointKey, snapshot.statusCode));
|
|
756
|
+
}
|
|
757
|
+
}
|
|
758
|
+
// 3. Breaking-change detection.
|
|
759
|
+
const breakingChanges = detectBreakingChanges(opts.previousSpec, opts.currentSpec);
|
|
760
|
+
// 4. Consumer-driven Pact verification + blast radius.
|
|
761
|
+
const consumerVerifications = [];
|
|
762
|
+
for (const contract of opts.pactContracts) {
|
|
763
|
+
const results = await verifyPactContract(contract, opts.providerFixture);
|
|
764
|
+
consumerVerifications.push(...results);
|
|
765
|
+
}
|
|
766
|
+
const blastRadius = buildBlastRadiusMap(consumerVerifications);
|
|
767
|
+
// 5. Error-contract validation.
|
|
768
|
+
const errorContractResults = [];
|
|
769
|
+
for (const [endpointKey, errorResp] of Object.entries(opts.errorResponses)) {
|
|
770
|
+
const errorSpec = opts.errorContracts.find((s) => s.statusCode === errorResp.statusCode);
|
|
771
|
+
if (errorSpec) {
|
|
772
|
+
errorContractResults.push(validateErrorContract(endpointKey, errorResp.statusCode, errorResp.body, errorSpec));
|
|
773
|
+
}
|
|
774
|
+
}
|
|
775
|
+
// 6. Runtime sample validation.
|
|
776
|
+
const runtimeSample = validateRuntimeSample(opts.runtimeSamples, opts.currentSpec);
|
|
777
|
+
// 7. Mock generation from current spec.
|
|
778
|
+
const mocks = generateMockHandlers(opts.currentSpec);
|
|
779
|
+
// 8. Migration guide (only when breaking changes exist).
|
|
780
|
+
const migrationGuide = draftMigrationGuide(breakingChanges, { clock: opts.clock });
|
|
781
|
+
const generatedAt = opts.clock ? new Date(opts.clock()).toISOString() : new Date().toISOString();
|
|
782
|
+
return {
|
|
783
|
+
skippedEndpoints: skipped,
|
|
784
|
+
schemaResults,
|
|
785
|
+
breakingChanges,
|
|
786
|
+
consumerVerifications,
|
|
787
|
+
blastRadius,
|
|
788
|
+
errorContractResults,
|
|
789
|
+
runtimeSample,
|
|
790
|
+
migrationGuide,
|
|
791
|
+
mocks,
|
|
792
|
+
engineFindings: opts.engineFindings ?? [],
|
|
793
|
+
generatedAt,
|
|
794
|
+
};
|
|
795
|
+
}
|
|
796
|
+
//# sourceMappingURL=api-contract-validator.js.map
|