@teevee98/synapse-hub 0.0.0-stage → 3.8.3
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/.agents/agents/api-engineer.md +67 -0
- package/.agents/agents/failure-analyst.md +75 -0
- package/.agents/agents/live-explorer.md +70 -0
- package/.agents/agents/orchestrator.md +104 -0
- package/.agents/agents/perf-engineer.md +74 -0
- package/.agents/agents/pom-crafter.md +112 -0
- package/.agents/agents/quality-gatekeeper.md +87 -0
- package/.agents/agents/test-designer.md +73 -0
- package/.agents/agents/test-runner.md +67 -0
- package/.agents/rules/author-integrity-guard.md +33 -0
- package/.agents/rules/communication-style.md +18 -0
- package/.agents/rules/context-engineering.md +37 -0
- package/.agents/rules/git-push-protocol.md +33 -0
- package/.agents/rules/graphify.md +14 -0
- package/.agents/rules/lessons-learned.md +25 -0
- package/.agents/rules/mandatory-playwright-live.md +25 -0
- package/.agents/rules/mobile_appium_rules.md +43 -0
- package/.agents/rules/performance_testing_rules.md +35 -0
- package/.agents/rules/skill-precedence.md +29 -0
- package/.agents/rules/systematic-debugging.md +36 -0
- package/.agents/skills/actor-qa-swarm/SKILL.md +77 -0
- package/.agents/skills/actor-qa-swarm/examples/broker_sharding_sample.json +12 -0
- package/.agents/skills/agent-orchestration-multi-agent-optimize/SKILL.md +88 -0
- package/.agents/skills/agent-orchestration-multi-agent-optimize/examples/swarm_workload_config.json +15 -0
- package/.agents/skills/agentless-qa-repair/SKILL.md +69 -0
- package/.agents/skills/agentless-qa-repair/examples/healing_report_sample.json +17 -0
- package/.agents/skills/agentless-qa-repair/examples/three_phase_repair_workflow.md +40 -0
- package/.agents/skills/antigravity-test-sentinel/SKILL.md +63 -0
- package/.agents/skills/antigravity-test-sentinel/examples/dod_gate_policy.json +11 -0
- package/.agents/skills/antigravity-test-sentinel/examples/sprint_dod_enforcement.md +47 -0
- package/.agents/skills/api-network-mocking-interception/SKILL.md +142 -0
- package/.agents/skills/api-network-mocking-interception/examples/network_route_stub.json +9 -0
- package/.agents/skills/api-spec-to-e2e-matrix/SKILL.md +80 -0
- package/.agents/skills/api-spec-to-e2e-matrix/examples/sample_openapi.json +19 -0
- package/.agents/skills/architecture-decision-records/SKILL.md +64 -0
- package/.agents/skills/architecture-decision-records/examples/0001-record-architecture-decisions.md +12 -0
- package/.agents/skills/auth-session-and-cookie-manager/SKILL.md +75 -0
- package/.agents/skills/auth-session-and-cookie-manager/examples/multi_role_auth_matrix.md +70 -0
- package/.agents/skills/auth-session-and-cookie-manager/examples/storage_state_sample.json +11 -0
- package/.agents/skills/backend-load-and-stress-patterns/SKILL.md +85 -0
- package/.agents/skills/backend-load-and-stress-patterns/examples/k6_load_test_sample.js +13 -0
- package/.agents/skills/backend-load-and-stress-patterns/references/k6_load_template.js +82 -0
- package/.agents/skills/bats-testing-patterns/SKILL.md +100 -0
- package/.agents/skills/bats-testing-patterns/examples/cli_runner_test.bats +6 -0
- package/.agents/skills/bats-testing-patterns/resources/implementation-playbook.md +614 -0
- package/.agents/skills/clean-pom-crafter/SKILL.md +110 -0
- package/.agents/skills/clean-pom-crafter/examples/standard_test_case.groovy +28 -0
- package/.agents/skills/clean-pom-crafter/references/pom_patterns.groovy +138 -0
- package/.agents/skills/code-refactoring-refactor-clean/SKILL.md +64 -0
- package/.agents/skills/code-refactoring-refactor-clean/examples/refactored_page_sample.groovy +9 -0
- package/.agents/skills/code-refactoring-refactor-clean/examples/refactored_playwright_pom.ts +52 -0
- package/.agents/skills/code-refactoring-refactor-clean/resources/implementation-playbook.md +881 -0
- package/.agents/skills/consumer-driven-contract-testing/SKILL.md +147 -0
- package/.agents/skills/consumer-driven-contract-testing/examples/order_service_pact.json +45 -0
- package/.agents/skills/db-state-verifier-and-seeder/SKILL.md +123 -0
- package/.agents/skills/db-state-verifier-and-seeder/examples/db_fixture_seed.json +12 -0
- package/.agents/skills/e2e-testing-patterns/SKILL.md +103 -0
- package/.agents/skills/e2e-testing-patterns/examples/playwright_sharded_config.ts +12 -0
- package/.agents/skills/e2e-testing-patterns/resources/implementation-playbook.md +522 -0
- package/.agents/skills/event-stream-qa-orchestrator/SKILL.md +79 -0
- package/.agents/skills/event-stream-qa-orchestrator/examples/timeline_sample.jsonl +2 -0
- package/.agents/skills/failure-autopsy-and-healing/SKILL.md +66 -0
- package/.agents/skills/failure-autopsy-and-healing/examples/closed_loop_healing_walkthrough.md +48 -0
- package/.agents/skills/failure-autopsy-and-healing/examples/sample_junit_failure.xml +8 -0
- package/.agents/skills/failure-autopsy-and-healing/references/healing_matrix.md +64 -0
- package/.agents/skills/failure-autopsy-and-healing/references/qa_investigation_protocol.md +56 -0
- package/.agents/skills/failure-autopsy-and-healing/scripts/triage_failures.sh +83 -0
- package/.agents/skills/file-and-report-validator/SKILL.md +90 -0
- package/.agents/skills/file-and-report-validator/examples/sample_export_schema.json +14 -0
- package/.agents/skills/flaky-test-sentinel-and-quarantine/SKILL.md +114 -0
- package/.agents/skills/flaky-test-sentinel-and-quarantine/examples/quarantine_registry.json +11 -0
- package/.agents/skills/gherkin-to-suite/SKILL.md +103 -0
- package/.agents/skills/gherkin-to-suite/examples/checkout.feature +39 -0
- package/.agents/skills/gherkin-to-suite/examples/suite_report_sample.json +334 -0
- package/.agents/skills/github-actions-templates/SKILL.md +77 -0
- package/.agents/skills/github-actions-templates/examples/matrix_test_pipeline.yml +8 -0
- package/.agents/skills/graphify-impact-analyzer/SKILL.md +76 -0
- package/.agents/skills/graphify-impact-analyzer/examples/dependency_blast_radius.json +8 -0
- package/.agents/skills/katalon-cli-runner/SKILL.md +76 -0
- package/.agents/skills/katalon-cli-runner/examples/headless_kre_exec.sh +3 -0
- package/.agents/skills/katalon-cli-runner/references/groovy-patterns.md +209 -0
- package/.agents/skills/katalon-cli-runner/references/katalon-api.md +155 -0
- package/.agents/skills/katalon-cli-runner/references/runner_commands.md +67 -0
- package/.agents/skills/lam-script-generator/SKILL.md +123 -0
- package/.agents/skills/lam-script-generator/examples/user_story_sample.md +8 -0
- package/.agents/skills/lean-code-ladder/SKILL.md +94 -0
- package/.agents/skills/lean-code-ladder/examples/ladder_walkthrough.md +37 -0
- package/.agents/skills/lean-impact-scoreboard/SKILL.md +48 -0
- package/.agents/skills/lean-impact-scoreboard/examples/sample_benchmark_gain.md +20 -0
- package/.agents/skills/lean-impact-scoreboard/examples/sample_scoreboard.md +15 -0
- package/.agents/skills/meta-prompt-crafter/SKILL.md +107 -0
- package/.agents/skills/meta-prompt-crafter/examples/qa_prompt_template.md +35 -0
- package/.agents/skills/mipro-prompt-compiler/SKILL.md +59 -0
- package/.agents/skills/mipro-prompt-compiler/examples/compiled_module_sample.json +22 -0
- package/.agents/skills/mipro-prompt-compiler/examples/dspy_assertion_optimizer_case.md +46 -0
- package/.agents/skills/mobile-appium-som/SKILL.md +88 -0
- package/.agents/skills/mobile-appium-som/examples/BaseScreen.java +88 -0
- package/.agents/skills/mobile-appium-som/examples/LoginScreen.java +46 -0
- package/.agents/skills/mobile-appium-som/examples/TC_MobileLogin.java +43 -0
- package/.agents/skills/persistent-planning-files/SKILL.md +108 -0
- package/.agents/skills/persistent-planning-files/examples/task_plan_example.md +56 -0
- package/.agents/skills/playwright-live-interaction/SKILL.md +131 -0
- package/.agents/skills/playwright-live-interaction/examples/live_probe_script.js +5 -0
- package/.agents/skills/playwright-live-interaction/references/advanced_superpowers.md +160 -0
- package/.agents/skills/playwright-live-interaction/references/compact_accessibility_snapshots.md +75 -0
- package/.agents/skills/playwright-live-interaction/references/recipes.md +388 -0
- package/.agents/skills/playwright-live-interaction/references/swarm_orchestration.md +134 -0
- package/.agents/skills/playwright-webapp-testing/SKILL.md +93 -0
- package/.agents/skills/playwright-webapp-testing/examples/server_lifecycle_playwright.py +63 -0
- package/.agents/skills/qa-aci-interface/SKILL.md +67 -0
- package/.agents/skills/qa-aci-interface/examples/surgical_code_window_walkthrough.md +40 -0
- package/.agents/skills/qa-aci-interface/examples/surgical_edit_sample.json +12 -0
- package/.agents/skills/qa-memory-os/SKILL.md +80 -0
- package/.agents/skills/qa-memory-os/examples/archival_memory_sample.json +21 -0
- package/.agents/skills/rbt-manual-testing/SKILL.md +137 -0
- package/.agents/skills/rbt-manual-testing/examples/checkout_rbt_manual_suite.md +25 -0
- package/.agents/skills/rbt-manual-testing/references/field_validation_checklist.md +29 -0
- package/.agents/skills/repo-quality-audit/SKILL.md +68 -0
- package/.agents/skills/repo-quality-audit/examples/sample_audit_walkthrough.md +15 -0
- package/.agents/skills/repo-quality-audit/examples/sample_repo_audit.md +33 -0
- package/.agents/skills/review-spec/SKILL.md +60 -0
- package/.agents/skills/review-spec/examples/pocock_grilling_decision_rubric.md +40 -0
- package/.agents/skills/review-spec/examples/sample_spec_review.md +33 -0
- package/.agents/skills/security-dast-sentinel/SKILL.md +119 -0
- package/.agents/skills/security-dast-sentinel/examples/dast_scan_config.json +10 -0
- package/.agents/skills/security-dast-sentinel/references/AI-AND-LLM.md +113 -0
- package/.agents/skills/security-dast-sentinel/references/ATTACK-CLASSES.md +89 -0
- package/.agents/skills/security-dast-sentinel/references/dast_recipes.ts +33 -0
- package/.agents/skills/self-healing-locator/SKILL.md +86 -0
- package/.agents/skills/self-healing-locator/examples/aom_diff_sample.json +16 -0
- package/.agents/skills/senior-code-review/SKILL.md +108 -0
- package/.agents/skills/senior-code-review/examples/sample_review_walkthrough.md +29 -0
- package/.agents/skills/skillspector-security-guard/SKILL.md +57 -0
- package/.agents/skills/skillspector-security-guard/examples/audit_threat_vectors_report.json +35 -0
- package/.agents/skills/skillspector-security-guard/examples/safe_mcp_config.json +12 -0
- package/.agents/skills/surgical-coding-principles/SKILL.md +89 -0
- package/.agents/skills/surgical-coding-principles/examples/surgical_vs_scope_creep.md +46 -0
- package/.agents/skills/synthetic-test-data-generator/SKILL.md +135 -0
- package/.agents/skills/synthetic-test-data-generator/examples/idempotent_data_recipe.json +9 -0
- package/.agents/skills/systematic-debugging/SKILL.md +100 -0
- package/.agents/skills/systematic-debugging/examples/four_phase_case.md +44 -0
- package/.agents/skills/technical-debt-harvester/SKILL.md +70 -0
- package/.agents/skills/technical-debt-harvester/examples/sample_debt_ledger.md +25 -0
- package/.agents/skills/technical-debt-harvester/examples/sample_ledger_output.md +20 -0
- package/.agents/skills/test-driven-development/SKILL.md +114 -0
- package/.agents/skills/test-driven-development/examples/red_green_refactor_qa.md +78 -0
- package/.agents/skills/token-and-context-optimizer/SKILL.md +70 -0
- package/.agents/skills/token-and-context-optimizer/examples/distilled_log_sample.txt +3 -0
- package/.agents/skills/token-and-context-optimizer/references/context_engineering_guide.md +49 -0
- package/.agents/skills/tot-exploratory-testing/SKILL.md +59 -0
- package/.agents/skills/tot-exploratory-testing/examples/payment_gateway_tot_tree.json +62 -0
- package/.agents/skills/tot-exploratory-testing/examples/tot_graph_sample.json +35 -0
- package/.agents/skills/verification-before-completion/SKILL.md +100 -0
- package/.agents/skills/verification-before-completion/examples/evidence_log_example.md +46 -0
- package/.agents/skills/visual-regression-sentinel/SKILL.md +82 -0
- package/.agents/skills/visual-regression-sentinel/examples/visual_mask_rules.json +9 -0
- package/.agents/skills/wcag-audit-patterns/SKILL.md +77 -0
- package/.agents/skills/wcag-audit-patterns/examples/wcag_compliance_checklist.json +10 -0
- package/.agents/skills/wcag-audit-patterns/resources/implementation-playbook.md +541 -0
- package/.agents/skills/web-agent-gym-benchmarking/SKILL.md +62 -0
- package/.agents/skills/web-agent-gym-benchmarking/examples/benchmark_report_sample.json +22 -0
- package/.agents/skills/web-agent-gym-benchmarking/examples/enterprise_tasks_suite.json +38 -0
- package/.agents/skills/web-vitals-and-performance-profiler/SKILL.md +65 -0
- package/.agents/skills/web-vitals-and-performance-profiler/examples/cwv_budget_policy.json +6 -0
- package/.agents/skills/web-vitals-and-performance-profiler/examples/playwright_cwv_profiler_fixture.ts +118 -0
- package/.agents/templates/completion_report.md +57 -0
- package/.agents/workflows/analyze_requirement_document.md +18 -0
- package/.agents/workflows/export_testcases_excel.md +32 -0
- package/.agents/workflows/generate_combinatorial_test_data.md +28 -0
- package/.agents/workflows/generate_cross_module_test_plan.md +37 -0
- package/.agents/workflows/generate_manual_testcases_rbt.md +56 -0
- package/.agents/workflows/generate_requirements_from_website.md +25 -0
- package/.agents/workflows/generate_testcases_from_requirements.md +21 -0
- package/.agents/workflows/graphify.md +10 -0
- package/.agents/workflows/test-impact.md +15 -0
- package/.agents/workflows/verify.md +34 -0
- package/.cursor/rules/agents.mdc +16 -0
- package/.cursor/rules/language.mdc +7 -0
- package/.cursor/rules/synapse-qa.mdc +24 -0
- package/.cursorrules +27 -0
- package/.dockerignore +53 -0
- package/.pre-commit-hooks.yaml +14 -0
- package/.windsurfrules +26 -0
- package/AGENTS.md +86 -0
- package/CLAUDE.md +54 -0
- package/Dockerfile +81 -0
- package/LICENSE +52 -0
- package/NOTICE +264 -0
- package/README.en.md +171 -0
- package/README.md +170 -2
- package/action.yml +51 -0
- package/agentskills.json +16 -0
- package/bin/agent-qa.js +138 -0
- package/docker-compose.yml +74 -0
- package/docs/ARCHITECTURE.en.md +198 -0
- package/docs/ARCHITECTURE.md +199 -0
- package/docs/CI_CD_INTEGRATION.en.md +170 -0
- package/docs/CI_CD_INTEGRATION.md +170 -0
- package/docs/CLI_REFERENCE.en.md +174 -0
- package/docs/CLI_REFERENCE.md +176 -0
- package/docs/CONTRIBUTING.en.md +49 -0
- package/docs/CONTRIBUTING.md +49 -0
- package/docs/PERFORMANCE_AUDIT_REPORT.md +783 -0
- package/docs/PLUGIN_DEVELOPMENT_GUIDE.md +127 -0
- package/docs/QUALITY_GATES.en.md +118 -0
- package/docs/QUALITY_GATES.md +118 -0
- package/docs/TOKEN_QUOTA_PLAYBOOK.md +41 -0
- package/docs/TOOL_CATALOG.md +129 -0
- package/docs/adopted-ecosystem-tools.md +96 -0
- package/docs/research/EXTERNAL_AGENT_SKILLS_SURVEY.md +1062 -0
- package/docs/research/agent_skill_training_analysis.md +1358 -0
- package/docs/schemas/synapse.config.schema.json +86 -0
- package/package.json +94 -4
- package/plugin.json +31 -0
- package/scripts/generate_skill_examples.py +244 -0
- package/scripts/install.ps1 +112 -0
- package/scripts/install_global_plugin.ps1 +94 -0
- package/scripts/install_global_plugin.sh +49 -0
- package/scripts/lint_skills.ps1 +57 -0
- package/scripts/package_dist.py +337 -0
- package/scripts/setup.sh +59 -0
- package/scripts/update_hub.ps1 +19 -0
- package/scripts/update_hub.sh +15 -0
- package/skills_manifest.json +854 -0
- package/synapse.config.json +31 -0
- package/templates/PROJECT_AI_GUIDE_TEMPLATE.md +111 -0
- package/templates/PROJECT_STATE_TEMPLATE.md +20 -0
- package/templates/ai_bridges/CLAUDE.md +54 -0
- package/templates/ai_bridges/copilot-instructions.md +20 -0
- package/templates/ai_bridges/cursor_synapse_qa.mdc +24 -0
- package/templates/ai_bridges/windsurfrules +26 -0
- package/templates/ci/github-actions-synapse.yml +95 -0
- package/templates/ci/gitlab-ci-synapse.yml +16 -0
- package/templates/ui/index.html +1069 -0
- package/templates/welcome.html.tmpl +2074 -0
- package/tools/.infer_baseline.json +30 -0
- package/tools/TOOLS_RUNBOOK.md +1553 -0
- package/tools/TOOL_CATALOG.json +1769 -0
- package/tools/__init__.py +43 -0
- package/tools/_openapi_parser.py +158 -0
- package/tools/agent_canary.py +525 -0
- package/tools/agentless_patcher.py +417 -0
- package/tools/analyze_project.py +262 -0
- package/tools/api_drift_sentinel.py +208 -0
- package/tools/api_fuzzer.py +762 -0
- package/tools/author_integrity.py +190 -0
- package/tools/auto_heal.py +271 -0
- package/tools/auto_heal_reflexion.py +532 -0
- package/tools/autogen_qa_broker.py +844 -0
- package/tools/benchmark_swarm_context.py +394 -0
- package/tools/browser_helpers.js +746 -0
- package/tools/browsergym_eval.py +236 -0
- package/tools/bug_reporter.py +252 -0
- package/tools/bump_version.py +423 -0
- package/tools/cache_resolver.py +1214 -0
- package/tools/check_env.py +426 -0
- package/tools/check_version_sync.py +256 -0
- package/tools/ci_healing_hook.py +126 -0
- package/tools/cli.py +1598 -0
- package/tools/config_decoupler.py +253 -0
- package/tools/contract_validator.py +141 -0
- package/tools/core/__init__.py +70 -0
- package/tools/core/adapters.py +431 -0
- package/tools/core/circuit_breaker.py +263 -0
- package/tools/core/cli_runtime.py +66 -0
- package/tools/core/file_lock.py +159 -0
- package/tools/core/i18n.py +394 -0
- package/tools/core/memory_bus.py +905 -0
- package/tools/core/process_supervisor.py +332 -0
- package/tools/core/telemetry.py +329 -0
- package/tools/count_tokens.py +1267 -0
- package/tools/create_mock_docx.py +104 -0
- package/tools/dashboard_generator.py +2403 -0
- package/tools/db_sandbox.py +675 -0
- package/tools/debt_harvester.py +237 -0
- package/tools/distill_log.py +161 -0
- package/tools/dspy_qa_signatures.py +356 -0
- package/tools/e2e_flow_prober.py +132 -0
- package/tools/export_postman_collection.py +945 -0
- package/tools/flaky_detector.py +389 -0
- package/tools/fsm_enforcer.py +450 -0
- package/tools/fsm_middleware.py +401 -0
- package/tools/fuzz_payloads.py +197 -0
- package/tools/generate_allure_report.py +88 -0
- package/tools/generate_api_matrix.py +193 -0
- package/tools/generate_jmx_plan.py +1322 -0
- package/tools/generate_sbom.py +252 -0
- package/tools/generate_tc_from_story.py +203 -0
- package/tools/generate_test_reports.py +133 -0
- package/tools/generate_tool_catalog.py +482 -0
- package/tools/gherkin_suite.py +758 -0
- package/tools/git_pre_commit_guard.py +298 -0
- package/tools/goldfish_review.py +366 -0
- package/tools/heal/__init__.py +28 -0
- package/tools/heal_pr_automator.py +220 -0
- package/tools/heuristic_locator_matcher.py +351 -0
- package/tools/hub_publisher.py +623 -0
- package/tools/humanize_linter.py +438 -0
- package/tools/infer_linter.py +977 -0
- package/tools/init_config.py +306 -0
- package/tools/interview_story.py +116 -0
- package/tools/jira_sync.py +566 -0
- package/tools/jtl_analyzer.py +474 -0
- package/tools/lint/__init__.py +30 -0
- package/tools/lint_ai_docs.py +374 -0
- package/tools/lookup_tc.py +165 -0
- package/tools/lookup_xpath.py +167 -0
- package/tools/matrix_sharder.py +148 -0
- package/tools/mcp/__init__.py +18 -0
- package/tools/mcp_docx_server.ps1 +13 -0
- package/tools/mcp_docx_server.py +851 -0
- package/tools/mcp_excel_server.ps1 +13 -0
- package/tools/mcp_excel_server.py +441 -0
- package/tools/mcp_server.py +725 -0
- package/tools/md_to_xlsx.py +327 -0
- package/tools/micro_mutator.py +887 -0
- package/tools/mipro_assertion_tuner.py +210 -0
- package/tools/network_mock_shield.py +311 -0
- package/tools/newman_analyzer.py +384 -0
- package/tools/omni_emitter.py +579 -0
- package/tools/omni_parser.py +450 -0
- package/tools/omni_transpiler.py +168 -0
- package/tools/openxml_guard.py +438 -0
- package/tools/output_formatter.py +182 -0
- package/tools/package_release.py +325 -0
- package/tools/perf/__init__.py +24 -0
- package/tools/pinpoint_failure.py +190 -0
- package/tools/project_state.py +171 -0
- package/tools/qa_event_stream.py +358 -0
- package/tools/repo_map.py +346 -0
- package/tools/report/__init__.py +32 -0
- package/tools/reversible_sandbox.py +344 -0
- package/tools/safety_firewall.py +437 -0
- package/tools/security_coverage_ledger.py +538 -0
- package/tools/security_scanner.py +229 -0
- package/tools/senior_code_review.py +393 -0
- package/tools/setup_project.py +770 -0
- package/tools/skill_collision_guard.py +304 -0
- package/tools/skill_profiles.py +217 -0
- package/tools/skill_vault.py +481 -0
- package/tools/skillspector.py +1278 -0
- package/tools/smart_visual_masker.py +132 -0
- package/tools/spec_drift_sentinel.py +438 -0
- package/tools/swe_qa_aci.py +369 -0
- package/tools/synapse_observer.py +485 -0
- package/tools/synapse_qa_bench.py +190 -0
- package/tools/sync_agent_rules.py +274 -0
- package/tools/telemetry_correlator.py +397 -0
- package/tools/template_excel_exporter.py +514 -0
- package/tools/templates/jmeter-distributed/README.md +54 -0
- package/tools/templates/jmeter-distributed/docker-compose.yml +83 -0
- package/tools/test_impact.py +419 -0
- package/tools/test_memory_os.py +462 -0
- package/tools/textgrad_mutation_optimizer.py +237 -0
- package/tools/tms_sync_bridge.py +834 -0
- package/tools/tot_exploratory_tester.py +239 -0
- package/tools/trace_data_flow.py +240 -0
- package/tools/traffic_session_converter.py +256 -0
- package/tools/trend_analytics.py +314 -0
- package/tools/ui_server.py +401 -0
- package/tools/universal_ir.py +488 -0
- package/tools/update_sentinel.py +383 -0
- package/tools/validate_groovy_scripts.py +173 -0
- package/tools/verify_all.py +1271 -0
- package/tools/visual_diff_canvas.py +143 -0
- package/tools/visual_som_helper.py +550 -0
- package/tools/watch_mode.py +308 -0
- package/tools/wcag_audit.py +239 -0
- package/tools/welcome_page.py +290 -0
|
@@ -0,0 +1,488 @@
|
|
|
1
|
+
#!/usr/bin/env python3
|
|
2
|
+
"""
|
|
3
|
+
Universal Testing Intermediate Representation (IR) Schema
|
|
4
|
+
---------------------------------------------------------
|
|
5
|
+
Defines a language-agnostic and framework-agnostic schema for test automation.
|
|
6
|
+
Represents pages, locators, methods, test cases, and assertions independently of
|
|
7
|
+
whether the target is Playwright, Selenium, Cypress, Katalon, or Appium.
|
|
8
|
+
"""
|
|
9
|
+
|
|
10
|
+
from enum import Enum
|
|
11
|
+
from typing import Dict, List, Optional, Any
|
|
12
|
+
from dataclasses import dataclass, field
|
|
13
|
+
import json
|
|
14
|
+
import re
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
class ActionType(str, Enum):
|
|
18
|
+
GOTO = "goto"
|
|
19
|
+
CLICK = "click"
|
|
20
|
+
DBLCLICK = "dblclick"
|
|
21
|
+
FILL = "fill"
|
|
22
|
+
PRESS_KEY = "press_key"
|
|
23
|
+
HOVER = "hover"
|
|
24
|
+
SELECT = "select"
|
|
25
|
+
CHECK = "check"
|
|
26
|
+
UNCHECK = "uncheck"
|
|
27
|
+
WAIT = "wait"
|
|
28
|
+
ASSERT = "assert"
|
|
29
|
+
CUSTOM_CALL = "custom_call"
|
|
30
|
+
API_CALL = "api_call"
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
class LocatorStrategy(str, Enum):
|
|
34
|
+
ROLE = "role"
|
|
35
|
+
LABEL = "label"
|
|
36
|
+
TEST_ID = "test_id"
|
|
37
|
+
TEXT = "text"
|
|
38
|
+
CSS = "css"
|
|
39
|
+
XPATH = "xpath"
|
|
40
|
+
PLACEHOLDER = "placeholder"
|
|
41
|
+
ID = "id"
|
|
42
|
+
NAME = "name"
|
|
43
|
+
CLASS_NAME = "class_name"
|
|
44
|
+
UNKNOWN = "unknown"
|
|
45
|
+
|
|
46
|
+
|
|
47
|
+
class AssertionType(str, Enum):
|
|
48
|
+
VISIBLE = "visible"
|
|
49
|
+
HIDDEN = "hidden"
|
|
50
|
+
EQUALS = "equals"
|
|
51
|
+
CONTAINS_TEXT = "contains_text"
|
|
52
|
+
HAS_VALUE = "has_value"
|
|
53
|
+
IS_ENABLED = "is_enabled"
|
|
54
|
+
IS_DISABLED = "is_disabled"
|
|
55
|
+
URL_CONTAINS = "url_contains"
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
class WaitStrategy(str, Enum):
|
|
59
|
+
AUTO = "auto"
|
|
60
|
+
EXPLICIT_VISIBLE = "explicit_visible"
|
|
61
|
+
NETWORK_IDLE = "network_idle"
|
|
62
|
+
STATIC_SLEEP = "static_sleep" # Flagged antipattern
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
class DataDependencyType(str, Enum):
|
|
66
|
+
ID = "id"
|
|
67
|
+
AUTH_TOKEN = "auth_token"
|
|
68
|
+
ORDER_NUMBER = "order_number"
|
|
69
|
+
EMAIL = "email"
|
|
70
|
+
SESSION = "session"
|
|
71
|
+
CUSTOM = "custom"
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
@dataclass
|
|
75
|
+
class HermeticFixture:
|
|
76
|
+
variable_name: str
|
|
77
|
+
fixture_type: str = "synthetic_mock" # "api_seed", "synthetic_mock", "auth_session"
|
|
78
|
+
seed_endpoint: Optional[str] = None
|
|
79
|
+
mock_data: Dict[str, Any] = field(default_factory=dict)
|
|
80
|
+
code_snippet: str = ""
|
|
81
|
+
|
|
82
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
83
|
+
return {
|
|
84
|
+
"variable_name": self.variable_name,
|
|
85
|
+
"fixture_type": self.fixture_type,
|
|
86
|
+
"seed_endpoint": self.seed_endpoint,
|
|
87
|
+
"mock_data": self.mock_data,
|
|
88
|
+
"code_snippet": self.code_snippet
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
@classmethod
|
|
92
|
+
def from_dict(cls, data: Dict[str, Any]) -> "HermeticFixture":
|
|
93
|
+
return cls(
|
|
94
|
+
variable_name=data.get("variable_name", ""),
|
|
95
|
+
fixture_type=data.get("fixture_type", "synthetic_mock"),
|
|
96
|
+
seed_endpoint=data.get("seed_endpoint"),
|
|
97
|
+
mock_data=data.get("mock_data", {}),
|
|
98
|
+
code_snippet=data.get("code_snippet", "")
|
|
99
|
+
)
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
@dataclass
|
|
103
|
+
class SharedStateVariable:
|
|
104
|
+
name: str
|
|
105
|
+
producer_test_id: Optional[str] = None
|
|
106
|
+
consumer_test_ids: List[str] = field(default_factory=list)
|
|
107
|
+
dep_type: DataDependencyType = DataDependencyType.CUSTOM
|
|
108
|
+
synthetic_fixture_code: str = ""
|
|
109
|
+
mock_route: Optional[str] = None
|
|
110
|
+
|
|
111
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
112
|
+
return {
|
|
113
|
+
"name": self.name,
|
|
114
|
+
"producer_test_id": self.producer_test_id,
|
|
115
|
+
"consumer_test_ids": self.consumer_test_ids,
|
|
116
|
+
"dep_type": self.dep_type.value if isinstance(self.dep_type, DataDependencyType) else self.dep_type,
|
|
117
|
+
"synthetic_fixture_code": self.synthetic_fixture_code,
|
|
118
|
+
"mock_route": self.mock_route
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
|
|
122
|
+
@dataclass
|
|
123
|
+
class LocatorIR:
|
|
124
|
+
name: str
|
|
125
|
+
strategy: LocatorStrategy
|
|
126
|
+
value: str
|
|
127
|
+
description: str = ""
|
|
128
|
+
|
|
129
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
130
|
+
return {
|
|
131
|
+
"name": self.name,
|
|
132
|
+
"strategy": self.strategy.value if isinstance(self.strategy, LocatorStrategy) else self.strategy,
|
|
133
|
+
"value": self.value,
|
|
134
|
+
"description": self.description,
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
@classmethod
|
|
138
|
+
def from_dict(cls, data: Dict[str, Any]) -> "LocatorIR":
|
|
139
|
+
strat = data.get("strategy", "unknown")
|
|
140
|
+
try:
|
|
141
|
+
strategy_enum = LocatorStrategy(strat)
|
|
142
|
+
except ValueError:
|
|
143
|
+
strategy_enum = LocatorStrategy.UNKNOWN
|
|
144
|
+
return cls(
|
|
145
|
+
name=data.get("name", "loc_unnamed"),
|
|
146
|
+
strategy=strategy_enum,
|
|
147
|
+
value=data.get("value", ""),
|
|
148
|
+
description=data.get("description", ""),
|
|
149
|
+
)
|
|
150
|
+
|
|
151
|
+
|
|
152
|
+
@dataclass
|
|
153
|
+
class StepIR:
|
|
154
|
+
action: ActionType
|
|
155
|
+
target: Optional[str] = None # Locator name or raw selector
|
|
156
|
+
value: Optional[str] = None # Input text, key code, URL, etc.
|
|
157
|
+
assertion_type: Optional[AssertionType] = None
|
|
158
|
+
expected: Optional[str] = None
|
|
159
|
+
wait_strategy: Optional[WaitStrategy] = None
|
|
160
|
+
is_sanitized_wait: bool = False
|
|
161
|
+
timeout_ms: int = 5000
|
|
162
|
+
description: str = ""
|
|
163
|
+
|
|
164
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
165
|
+
return {
|
|
166
|
+
"action": self.action.value if isinstance(self.action, ActionType) else self.action,
|
|
167
|
+
"target": self.target,
|
|
168
|
+
"value": self.value,
|
|
169
|
+
"assertion_type": self.assertion_type.value if isinstance(self.assertion_type, AssertionType) and self.assertion_type else (self.assertion_type or None),
|
|
170
|
+
"expected": self.expected,
|
|
171
|
+
"wait_strategy": self.wait_strategy.value if isinstance(self.wait_strategy, WaitStrategy) and self.wait_strategy else (self.wait_strategy or None),
|
|
172
|
+
"is_sanitized_wait": self.is_sanitized_wait,
|
|
173
|
+
"timeout_ms": self.timeout_ms,
|
|
174
|
+
"description": self.description,
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
@classmethod
|
|
178
|
+
def from_dict(cls, data: Dict[str, Any]) -> "StepIR":
|
|
179
|
+
act = data.get("action", "custom_call")
|
|
180
|
+
try:
|
|
181
|
+
act_enum = ActionType(act)
|
|
182
|
+
except ValueError:
|
|
183
|
+
act_enum = ActionType.CUSTOM_CALL
|
|
184
|
+
|
|
185
|
+
assert_type = data.get("assertion_type")
|
|
186
|
+
assert_enum = None
|
|
187
|
+
if assert_type:
|
|
188
|
+
try:
|
|
189
|
+
assert_enum = AssertionType(assert_type)
|
|
190
|
+
except ValueError:
|
|
191
|
+
assert_enum = None
|
|
192
|
+
|
|
193
|
+
wait_strat = data.get("wait_strategy")
|
|
194
|
+
wait_enum = None
|
|
195
|
+
if wait_strat:
|
|
196
|
+
try:
|
|
197
|
+
wait_enum = WaitStrategy(wait_strat)
|
|
198
|
+
except ValueError:
|
|
199
|
+
wait_enum = None
|
|
200
|
+
|
|
201
|
+
return cls(
|
|
202
|
+
action=act_enum,
|
|
203
|
+
target=data.get("target"),
|
|
204
|
+
value=data.get("value"),
|
|
205
|
+
assertion_type=assert_enum,
|
|
206
|
+
expected=data.get("expected"),
|
|
207
|
+
wait_strategy=wait_enum,
|
|
208
|
+
is_sanitized_wait=data.get("is_sanitized_wait", False),
|
|
209
|
+
timeout_ms=data.get("timeout_ms", 5000),
|
|
210
|
+
description=data.get("description", ""),
|
|
211
|
+
)
|
|
212
|
+
|
|
213
|
+
|
|
214
|
+
@dataclass
|
|
215
|
+
class MethodIR:
|
|
216
|
+
name: str
|
|
217
|
+
parameters: List[str] = field(default_factory=list)
|
|
218
|
+
return_type: str = "void"
|
|
219
|
+
steps: List[StepIR] = field(default_factory=list)
|
|
220
|
+
description: str = ""
|
|
221
|
+
|
|
222
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
223
|
+
return {
|
|
224
|
+
"name": self.name,
|
|
225
|
+
"parameters": self.parameters,
|
|
226
|
+
"return_type": self.return_type,
|
|
227
|
+
"steps": [s.to_dict() for s in self.steps],
|
|
228
|
+
"description": self.description,
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
@classmethod
|
|
232
|
+
def from_dict(cls, data: Dict[str, Any]) -> "MethodIR":
|
|
233
|
+
return cls(
|
|
234
|
+
name=data.get("name", "execute"),
|
|
235
|
+
parameters=data.get("parameters", []),
|
|
236
|
+
return_type=data.get("return_type", "void"),
|
|
237
|
+
steps=[StepIR.from_dict(s) for s in data.get("steps", [])],
|
|
238
|
+
description=data.get("description", ""),
|
|
239
|
+
)
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
@dataclass
|
|
243
|
+
class PageClassIR:
|
|
244
|
+
name: str
|
|
245
|
+
base_class: str = "BasePage"
|
|
246
|
+
url: Optional[str] = None
|
|
247
|
+
locators: List[LocatorIR] = field(default_factory=list)
|
|
248
|
+
methods: List[MethodIR] = field(default_factory=list)
|
|
249
|
+
description: str = ""
|
|
250
|
+
|
|
251
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
252
|
+
return {
|
|
253
|
+
"name": self.name,
|
|
254
|
+
"base_class": self.base_class,
|
|
255
|
+
"url": self.url,
|
|
256
|
+
"locators": [loc.to_dict() for loc in self.locators],
|
|
257
|
+
"methods": [m.to_dict() for m in self.methods],
|
|
258
|
+
"description": self.description,
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
@classmethod
|
|
262
|
+
def from_dict(cls, data: Dict[str, Any]) -> "PageClassIR":
|
|
263
|
+
return cls(
|
|
264
|
+
name=data.get("name", "UnnamedPage"),
|
|
265
|
+
base_class=data.get("base_class", "BasePage"),
|
|
266
|
+
url=data.get("url"),
|
|
267
|
+
locators=[LocatorIR.from_dict(loc) for loc in data.get("locators", [])],
|
|
268
|
+
methods=[MethodIR.from_dict(m) for m in data.get("methods", [])],
|
|
269
|
+
description=data.get("description", ""),
|
|
270
|
+
)
|
|
271
|
+
|
|
272
|
+
|
|
273
|
+
@dataclass
|
|
274
|
+
class TestCaseIR:
|
|
275
|
+
# IR model, not a pytest test class - prefix "Test" must not trigger collection.
|
|
276
|
+
__test__ = False
|
|
277
|
+
|
|
278
|
+
id: str
|
|
279
|
+
title: str
|
|
280
|
+
steps: List[StepIR] = field(default_factory=list)
|
|
281
|
+
tags: List[str] = field(default_factory=list)
|
|
282
|
+
description: str = ""
|
|
283
|
+
produced_variables: List[str] = field(default_factory=list)
|
|
284
|
+
consumed_variables: List[str] = field(default_factory=list)
|
|
285
|
+
hermetic_fixtures: List[HermeticFixture] = field(default_factory=list)
|
|
286
|
+
|
|
287
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
288
|
+
return {
|
|
289
|
+
"id": self.id,
|
|
290
|
+
"title": self.title,
|
|
291
|
+
"steps": [s.to_dict() for s in self.steps],
|
|
292
|
+
"tags": self.tags,
|
|
293
|
+
"description": self.description,
|
|
294
|
+
"produced_variables": self.produced_variables,
|
|
295
|
+
"consumed_variables": self.consumed_variables,
|
|
296
|
+
"hermetic_fixtures": [hf.to_dict() for hf in self.hermetic_fixtures],
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
@classmethod
|
|
300
|
+
def from_dict(cls, data: Dict[str, Any]) -> "TestCaseIR":
|
|
301
|
+
return cls(
|
|
302
|
+
id=data.get("id", "TC_001"),
|
|
303
|
+
title=data.get("title", "Automated Test Case"),
|
|
304
|
+
steps=[StepIR.from_dict(s) for s in data.get("steps", [])],
|
|
305
|
+
tags=data.get("tags", []),
|
|
306
|
+
description=data.get("description", ""),
|
|
307
|
+
produced_variables=data.get("produced_variables", []),
|
|
308
|
+
consumed_variables=data.get("consumed_variables", []),
|
|
309
|
+
hermetic_fixtures=[HermeticFixture.from_dict(hf) for hf in data.get("hermetic_fixtures", [])],
|
|
310
|
+
)
|
|
311
|
+
|
|
312
|
+
|
|
313
|
+
CURRENT_SCHEMA_VERSION = "1.0.0"
|
|
314
|
+
|
|
315
|
+
|
|
316
|
+
@dataclass
|
|
317
|
+
class ProjectIR:
|
|
318
|
+
schema_version: str = CURRENT_SCHEMA_VERSION
|
|
319
|
+
name: str = "OmniTestProject"
|
|
320
|
+
source_language: str = "generic"
|
|
321
|
+
source_framework: str = "generic"
|
|
322
|
+
pages: List[PageClassIR] = field(default_factory=list)
|
|
323
|
+
test_cases: List[TestCaseIR] = field(default_factory=list)
|
|
324
|
+
|
|
325
|
+
def to_dict(self) -> Dict[str, Any]:
|
|
326
|
+
return {
|
|
327
|
+
"schema_version": self.schema_version,
|
|
328
|
+
"name": self.name,
|
|
329
|
+
"source_language": self.source_language,
|
|
330
|
+
"source_framework": self.source_framework,
|
|
331
|
+
"pages": [p.to_dict() for p in self.pages],
|
|
332
|
+
"test_cases": [tc.to_dict() for tc in self.test_cases],
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
def to_json(self, indent: int = 2) -> str:
|
|
336
|
+
return json.dumps(self.to_dict(), indent=indent, ensure_ascii=False)
|
|
337
|
+
|
|
338
|
+
@classmethod
|
|
339
|
+
def from_dict(cls, data: Dict[str, Any]) -> "ProjectIR":
|
|
340
|
+
return cls(
|
|
341
|
+
schema_version=data.get("schema_version", CURRENT_SCHEMA_VERSION),
|
|
342
|
+
name=data.get("name", "OmniTestProject"),
|
|
343
|
+
source_language=data.get("source_language", "generic"),
|
|
344
|
+
source_framework=data.get("source_framework", "generic"),
|
|
345
|
+
pages=[PageClassIR.from_dict(p) for p in data.get("pages", [])],
|
|
346
|
+
test_cases=[TestCaseIR.from_dict(tc) for tc in data.get("test_cases", [])],
|
|
347
|
+
)
|
|
348
|
+
|
|
349
|
+
@classmethod
|
|
350
|
+
def from_json(cls, json_str: str) -> "ProjectIR":
|
|
351
|
+
data = json.loads(json_str)
|
|
352
|
+
return cls.from_dict(data)
|
|
353
|
+
|
|
354
|
+
|
|
355
|
+
SHARED_VAR_PATTERNS = [
|
|
356
|
+
(r"\b(?:created_id|order_id|user_id|item_id|customer_id|invoice_id)\b", DataDependencyType.ID),
|
|
357
|
+
(r"\b(?:auth_token|bearer_token|access_token|jwt_token|token)\b", DataDependencyType.AUTH_TOKEN),
|
|
358
|
+
(r"\b(?:last_order_number|order_number|receipt_no|tracking_code)\b", DataDependencyType.ORDER_NUMBER),
|
|
359
|
+
(r"\b(?:email|user_email|customer_email)\b", DataDependencyType.EMAIL),
|
|
360
|
+
(r"\b(?:session_id|cookie_session|session_token)\b", DataDependencyType.SESSION),
|
|
361
|
+
]
|
|
362
|
+
|
|
363
|
+
|
|
364
|
+
def analyze_data_dependencies(project: ProjectIR) -> List[SharedStateVariable]:
|
|
365
|
+
"""
|
|
366
|
+
Hermetic State & Data-Dependency Resolver:
|
|
367
|
+
Performs data-flow analysis across test cases in ProjectIR to identify shared state
|
|
368
|
+
and test coupling (variables produced in one test and consumed in another).
|
|
369
|
+
"""
|
|
370
|
+
producers: Dict[str, str] = {}
|
|
371
|
+
consumers: Dict[str, List[str]] = {}
|
|
372
|
+
var_types: Dict[str, DataDependencyType] = {}
|
|
373
|
+
|
|
374
|
+
for tc in project.test_cases:
|
|
375
|
+
tc_produced = set(tc.produced_variables)
|
|
376
|
+
tc_consumed = set(tc.consumed_variables)
|
|
377
|
+
|
|
378
|
+
for s in tc.steps:
|
|
379
|
+
text = f"{s.target or ''} {s.value or ''} {s.description or ''}"
|
|
380
|
+
|
|
381
|
+
creation_match = re.search(
|
|
382
|
+
r"\b(?:const|let|var|def|String|int)?\s*([a-zA-Z0-9_]+)\s*=\s*(?:response|created|new|generate|extract|get)",
|
|
383
|
+
text,
|
|
384
|
+
re.I
|
|
385
|
+
)
|
|
386
|
+
if creation_match:
|
|
387
|
+
var_name = creation_match.group(1).lower()
|
|
388
|
+
tc_produced.add(var_name)
|
|
389
|
+
if var_name not in producers:
|
|
390
|
+
producers[var_name] = tc.id
|
|
391
|
+
|
|
392
|
+
for pattern, dep_type in SHARED_VAR_PATTERNS:
|
|
393
|
+
matches = re.findall(pattern, text, re.I)
|
|
394
|
+
for m in matches:
|
|
395
|
+
v_name = m.lower()
|
|
396
|
+
var_types[v_name] = dep_type
|
|
397
|
+
if v_name not in tc_produced:
|
|
398
|
+
tc_consumed.add(v_name)
|
|
399
|
+
if v_name not in consumers:
|
|
400
|
+
consumers[v_name] = []
|
|
401
|
+
if tc.id not in consumers[v_name]:
|
|
402
|
+
consumers[v_name].append(tc.id)
|
|
403
|
+
|
|
404
|
+
tc.produced_variables = sorted(list(tc_produced))
|
|
405
|
+
tc.consumed_variables = sorted(list(tc_consumed))
|
|
406
|
+
|
|
407
|
+
shared_vars: List[SharedStateVariable] = []
|
|
408
|
+
all_var_names = set(producers.keys()) | set(consumers.keys())
|
|
409
|
+
for v_name in sorted(all_var_names):
|
|
410
|
+
d_type = var_types.get(v_name, DataDependencyType.CUSTOM)
|
|
411
|
+
shared_vars.append(SharedStateVariable(
|
|
412
|
+
name=v_name,
|
|
413
|
+
producer_test_id=producers.get(v_name),
|
|
414
|
+
consumer_test_ids=consumers.get(v_name, []),
|
|
415
|
+
dep_type=d_type,
|
|
416
|
+
synthetic_fixture_code=f"const {v_name} = 'HERMETIC_AUTO_' + Date.now();",
|
|
417
|
+
mock_route=f"/api/v1/mock/{v_name}"
|
|
418
|
+
))
|
|
419
|
+
|
|
420
|
+
return shared_vars
|
|
421
|
+
|
|
422
|
+
|
|
423
|
+
def resolve_hermetic_fixtures(project: ProjectIR) -> ProjectIR:
|
|
424
|
+
"""
|
|
425
|
+
Transforms coupled test cases into 100% Hermetic Tests:
|
|
426
|
+
Auto-generates and prepends Pre-flight Fixtures or API Data Seeds for any test case
|
|
427
|
+
consuming external state without producing it locally.
|
|
428
|
+
Enables zero-collision parallel sharding and isolated test impact execution.
|
|
429
|
+
"""
|
|
430
|
+
shared_vars = analyze_data_dependencies(project)
|
|
431
|
+
var_map = {sv.name: sv for sv in shared_vars}
|
|
432
|
+
|
|
433
|
+
for tc in project.test_cases:
|
|
434
|
+
fixtures_to_inject = []
|
|
435
|
+
for consumed in list(tc.consumed_variables):
|
|
436
|
+
if consumed not in tc.produced_variables:
|
|
437
|
+
sv = var_map.get(consumed)
|
|
438
|
+
dep_type = sv.dep_type if sv else DataDependencyType.CUSTOM
|
|
439
|
+
|
|
440
|
+
if dep_type in (DataDependencyType.AUTH_TOKEN, DataDependencyType.SESSION):
|
|
441
|
+
fixture = HermeticFixture(
|
|
442
|
+
variable_name=consumed,
|
|
443
|
+
fixture_type="auth_session",
|
|
444
|
+
seed_endpoint="/api/v1/auth/mock",
|
|
445
|
+
mock_data={"token": "HERMETIC_MOCK_JWT", "role": "ADMIN", "active": True},
|
|
446
|
+
code_snippet=f"// Hermetic Auth Fixture\nawait page.setExtraHTTPHeaders({{ Authorization: 'Bearer HERMETIC_JWT_{consumed}' }});"
|
|
447
|
+
)
|
|
448
|
+
seed_step = StepIR(
|
|
449
|
+
action=ActionType.API_CALL,
|
|
450
|
+
target="/api/v1/auth/session",
|
|
451
|
+
value=f'{{"{consumed}": "HERMETIC_MOCK_JWT", "status": "ACTIVE"}}',
|
|
452
|
+
description=f"Hermetic Pre-flight: Injected Zero-Second Auth Session for {consumed}"
|
|
453
|
+
)
|
|
454
|
+
elif dep_type in (DataDependencyType.ID, DataDependencyType.ORDER_NUMBER):
|
|
455
|
+
endpoint = f"/api/v1/{consumed.replace('_id', 's')}/seed"
|
|
456
|
+
fixture = HermeticFixture(
|
|
457
|
+
variable_name=consumed,
|
|
458
|
+
fixture_type="api_seed",
|
|
459
|
+
seed_endpoint=endpoint,
|
|
460
|
+
mock_data={"id": f"AUTO_{consumed.upper()}_SEED", "status": "CONFIRMED"},
|
|
461
|
+
code_snippet=f"const {consumed} = 'AUTO_SEED_' + Date.now();"
|
|
462
|
+
)
|
|
463
|
+
seed_step = StepIR(
|
|
464
|
+
action=ActionType.API_CALL,
|
|
465
|
+
target=endpoint,
|
|
466
|
+
value=f'{{"{consumed}": "AUTO_SEED_" + Date.now(), "status": "CONFIRMED"}}',
|
|
467
|
+
description=f"Hermetic Pre-flight: Seed direct API data record for {consumed}"
|
|
468
|
+
)
|
|
469
|
+
else:
|
|
470
|
+
fixture = HermeticFixture(
|
|
471
|
+
variable_name=consumed,
|
|
472
|
+
fixture_type="synthetic_mock",
|
|
473
|
+
code_snippet=f"const {consumed} = 'HERMETIC_' + Date.now();"
|
|
474
|
+
)
|
|
475
|
+
seed_step = StepIR(
|
|
476
|
+
action=ActionType.CUSTOM_CALL,
|
|
477
|
+
value=f"const {consumed} = 'HERMETIC_' + Date.now();",
|
|
478
|
+
description=f"Hermetic Pre-flight: Synthetic state generator for {consumed}"
|
|
479
|
+
)
|
|
480
|
+
|
|
481
|
+
tc.hermetic_fixtures.append(fixture)
|
|
482
|
+
fixtures_to_inject.append(seed_step)
|
|
483
|
+
tc.produced_variables.append(consumed)
|
|
484
|
+
|
|
485
|
+
if fixtures_to_inject:
|
|
486
|
+
tc.steps = fixtures_to_inject + tc.steps
|
|
487
|
+
|
|
488
|
+
return project
|