@orion-qa/orion 3.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/.claude/agents/automation-strategist.md +1 -0
- package/.claude/agents/change-agent.md +1 -0
- package/.claude/agents/codebase-analyst.md +2 -1
- package/.claude/agents/environment-discovery.md +1 -0
- package/.claude/agents/evidence-validator.md +1 -0
- package/.claude/agents/executor.md +1 -0
- package/.claude/agents/failure-analyst.md +2 -1
- package/.claude/agents/implementer.md +2 -1
- package/.claude/agents/requirement-analyst.md +1 -0
- package/.claude/agents/reviewer.md +1 -0
- package/.claude/agents/test-reporter.md +1 -0
- package/.claude/settings.json +25 -0
- package/.claude/skills/appium/SKILL.md +1 -1
- package/.claude/skills/appium/templates/README.md +6 -9
- package/.claude/skills/appium/templates/ci/github-actions-android.yml +8 -2
- package/.claude/skills/appium/templates/ci/github-actions-ios.yml +8 -2
- package/.claude/skills/appium/templates/ci/github-actions-windows.yml +9 -2
- package/.claude/skills/appium/templates/project-java/.env.example +4 -0
- package/.claude/skills/appium/templates/project-java/pom.xml +2 -0
- package/.claude/skills/appium/templates/project-java/src/test/java/automation/{framework/Config.java → config/Env.java} +43 -52
- package/.claude/skills/appium/templates/project-java/src/test/java/automation/config/Flags.java +45 -0
- package/.claude/skills/appium/templates/project-java/src/test/java/automation/config/Paths.java +14 -0
- package/.claude/skills/appium/templates/project-java/src/test/java/automation/desc/SignInDesc.java +30 -0
- package/.claude/skills/appium/templates/project-java/src/test/java/automation/{framework → driver}/DriverFactory.java +19 -13
- package/.claude/skills/appium/templates/project-java/src/test/java/automation/{framework → driver}/DriverManager.java +12 -9
- package/.claude/skills/appium/templates/project-java/src/test/java/automation/fixtures/BaseTest.java +75 -0
- package/.claude/skills/appium/templates/project-java/src/test/java/automation/{screens → pageObjects}/BaseScreen.java +12 -12
- package/.claude/skills/appium/templates/project-java/src/test/java/automation/pageObjects/HomeScreen.java +26 -0
- package/.claude/skills/appium/templates/project-java/src/test/java/automation/pageObjects/LoginScreen.java +63 -0
- package/.claude/skills/appium/templates/project-java/src/test/java/automation/pageObjects/ShellScreen.java +26 -0
- package/.claude/skills/appium/templates/project-java/src/test/java/automation/setup/AuthSetup.java +49 -0
- package/.claude/skills/appium/templates/project-java/src/test/java/automation/testData/TestData.java +78 -0
- package/.claude/skills/appium/templates/project-java/src/test/java/automation/tests/ui/SignInTest.java +45 -0
- package/.claude/skills/appium/templates/project-java/src/test/java/automation/tests/unit/UtilsTest.java +34 -0
- package/.claude/skills/appium/templates/project-java/src/test/java/automation/{framework → utils}/AutomationError.java +4 -4
- package/.claude/skills/appium/templates/project-java/src/test/java/automation/utils/Case.java +20 -0
- package/.claude/skills/appium/templates/project-java/src/test/java/automation/utils/CaseTransformer.java +54 -0
- package/.claude/skills/appium/templates/project-java/src/test/java/automation/utils/Dates.java +42 -0
- package/.claude/skills/appium/templates/project-java/src/test/java/automation/utils/Log.java +45 -0
- package/.claude/skills/appium/templates/project-java/src/test/java/automation/utils/MissingSettingError.java +13 -0
- package/.claude/skills/appium/templates/project-java/src/test/java/automation/utils/RandomData.java +41 -0
- package/.claude/skills/appium/templates/project-java/src/test/java/automation/utils/Redact.java +33 -0
- package/.claude/skills/appium/templates/project-java/src/test/java/automation/utils/TestDescription.java +25 -0
- package/.claude/skills/appium/templates/project-java/src/test/resources/testData/testData.properties +7 -0
- package/.claude/skills/appium/templates/project-java/testng.xml +11 -4
- package/.claude/skills/architecture-analysis/SKILL.md +3 -2
- package/.claude/skills/automation-implementation/SKILL.md +8 -5
- package/.claude/skills/automation-implementation/references/patterns.md +46 -24
- package/.claude/skills/automation-review/references/assertion-guard.md +1 -1
- package/.claude/skills/code-review/SKILL.md +5 -2
- package/.claude/skills/code-review/references/pattern-rules.md +12 -7
- package/.claude/skills/documentation/SKILL.md +23 -18
- package/.claude/skills/execution/SKILL.md +7 -3
- package/.claude/skills/httpclient/templates/README.md +6 -7
- package/.claude/skills/httpclient/templates/csharp-nunit/.env.example +4 -0
- package/.claude/skills/httpclient/templates/csharp-nunit/Automation.csproj +7 -3
- package/.claude/skills/httpclient/templates/csharp-nunit/Config/Env.cs +62 -0
- package/.claude/skills/httpclient/templates/csharp-nunit/Config/Flags.cs +35 -0
- package/.claude/skills/httpclient/templates/csharp-nunit/Config/Paths.cs +22 -0
- package/.claude/skills/httpclient/templates/csharp-nunit/Fixtures/BaseTest.cs +22 -0
- package/.claude/skills/httpclient/templates/csharp-nunit/Resources/Desc/ProductsDesc.cs +22 -0
- package/.claude/skills/httpclient/templates/csharp-nunit/Resources/TestData/TestData.cs +61 -0
- package/.claude/skills/httpclient/templates/csharp-nunit/Resources/TestData/testData.json +9 -0
- package/.claude/skills/httpclient/templates/csharp-nunit/Services/ApiClient.cs +48 -0
- package/.claude/skills/httpclient/templates/csharp-nunit/Services/HealthApi.cs +11 -0
- package/.claude/skills/httpclient/templates/csharp-nunit/{Api → Services}/ProductsApi.cs +8 -5
- package/.claude/skills/httpclient/templates/csharp-nunit/Tests/Api/ProductsTests.cs +61 -0
- package/.claude/skills/httpclient/templates/csharp-nunit/Tests/Unit/UtilsTests.cs +40 -0
- package/.claude/skills/httpclient/templates/csharp-nunit/Utils/AutomationError.cs +15 -0
- package/.claude/skills/httpclient/templates/csharp-nunit/Utils/Dates.cs +18 -0
- package/.claude/skills/httpclient/templates/csharp-nunit/Utils/Log.cs +37 -0
- package/.claude/skills/httpclient/templates/csharp-nunit/Utils/RandomData.cs +26 -0
- package/.claude/skills/httpclient/templates/csharp-nunit/Utils/Redact.cs +22 -0
- package/.claude/skills/httpclient/templates/csharp-nunit/Utils/TestDescription.cs +55 -0
- package/.claude/skills/javascript/references/sources.md +1 -1
- package/.claude/skills/k6/SKILL.md +1 -1
- package/.claude/skills/k6/templates/README.md +5 -3
- package/.claude/skills/k6/templates/project/{data/cases.js → resources/desc/products.desc.js} +1 -1
- package/.claude/skills/k6/templates/project/resources/testData/testData.js +32 -0
- package/.claude/skills/k6/templates/project/{lib/config.js → src/config/env.js} +10 -5
- package/.claude/skills/k6/templates/project/{lib → src/services}/products-api.js +7 -5
- package/.claude/skills/k6/templates/project/{load → tests/load}/products.js +8 -8
- package/.claude/skills/karate/templates/README.md +4 -5
- package/.claude/skills/karate/templates/java-junit5/.env.example +2 -0
- package/.claude/skills/karate/templates/java-junit5/pom.xml +4 -0
- package/.claude/skills/karate/templates/java-junit5/src/test/java/{support → config}/EnvSettings.java +1 -1
- package/.claude/skills/karate/templates/java-junit5/src/test/java/karate-config.js +13 -6
- package/.claude/skills/karate/templates/java-junit5/src/test/java/logback-test.xml +1 -1
- package/.claude/skills/karate/templates/java-junit5/src/test/java/{api → tests}/ApiTest.java +7 -4
- package/.claude/skills/karate/templates/java-junit5/src/test/java/{api → tests/api}/health.feature +3 -3
- package/.claude/skills/karate/templates/java-junit5/src/test/java/tests/api/products.feature +29 -0
- package/.claude/skills/karate/templates/java-junit5/src/test/java/{support → utils}/MaskingLogModifier.java +1 -1
- package/.claude/skills/karate/templates/java-junit5/src/test/resources/testData/newProduct.js +7 -0
- package/.claude/skills/karate/templates/java-junit5/src/test/resources/testData/testData.json +6 -0
- package/.claude/skills/newman/templates/README.md +4 -5
- package/.claude/skills/newman/templates/collection/.env.example +2 -0
- package/.claude/skills/newman/templates/collection/collections/api.postman_collection.json +165 -145
- package/.claude/skills/newman/templates/collection/package.json +2 -1
- package/.claude/skills/newman/templates/collection/resources/desc/products.desc.json +53 -0
- package/.claude/skills/newman/templates/collection/resources/testData/testData.json +10 -0
- package/.claude/skills/newman/templates/collection/run.js +41 -31
- package/.claude/skills/newman/templates/collection/src/config/env.js +37 -0
- package/.claude/skills/orion/SKILL.md +19 -12
- package/.claude/skills/orion/references/assess-fix.md +35 -0
- package/.claude/skills/orion/references/batch.md +64 -0
- package/.claude/skills/orion/references/blockers.md +1 -1
- package/.claude/skills/orion/references/capabilities.md +1 -1
- package/.claude/skills/orion/references/conversation.md +65 -20
- package/.claude/skills/orion/references/delivery-formats.md +24 -36
- package/.claude/skills/orion/references/doctor.md +1 -1
- package/.claude/skills/orion/references/hosts.md +1 -0
- package/.claude/skills/orion/references/modes.md +7 -3
- package/.claude/skills/orion/references/plain-language.md +55 -0
- package/.claude/skills/orion/references/project-context-files.md +8 -2
- package/.claude/skills/orion/references/recovery-loop.md +8 -0
- package/.claude/skills/orion/references/setup-card.md +29 -8
- package/.claude/skills/orion/references/status-lines.md +9 -4
- package/.claude/skills/orion/references/task-brief.md +1 -0
- package/.claude/skills/orion/references/work-branch.md +3 -1
- package/.claude/skills/orion/scripts/batch_detect.mjs +98 -0
- package/.claude/skills/orion/scripts/batch_state.mjs +179 -0
- package/.claude/skills/orion/scripts/browser_setup.mjs +41 -21
- package/.claude/skills/orion/scripts/cases_export.py +724 -0
- package/.claude/skills/orion/scripts/codemap.mjs +116 -0
- package/.claude/skills/orion/scripts/done_check.mjs +195 -0
- package/.claude/skills/orion/scripts/env_check.mjs +8 -3
- package/.claude/skills/orion/scripts/env_check.py +12 -5
- package/.claude/skills/orion/scripts/fix_plan.mjs +170 -0
- package/.claude/skills/orion/scripts/graph.mjs +400 -0
- package/.claude/skills/orion/scripts/hooks/lean_guard.mjs +162 -0
- package/.claude/skills/orion/scripts/lib/inside.mjs +31 -0
- package/.claude/skills/orion/scripts/lib/scan.mjs +357 -0
- package/.claude/skills/orion/scripts/lib/table.mjs +116 -0
- package/.claude/skills/orion/scripts/parity_check.mjs +166 -0
- package/.claude/skills/orion/scripts/quiet.mjs +160 -0
- package/.claude/skills/orion/scripts/report_check.mjs +77 -0
- package/.claude/skills/orion/scripts/results_parse.mjs +209 -0
- package/.claude/skills/orion/scripts/reuse_check.mjs +251 -0
- package/.claude/skills/orion/scripts/rules.mjs +92 -0
- package/.claude/skills/orion/scripts/run_state.mjs +238 -0
- package/.claude/skills/orion/scripts/suite_check.mjs +267 -0
- package/.claude/skills/orion/scripts/timing_profile.mjs +128 -0
- package/.claude/skills/orion/scripts/usage_report.mjs +315 -0
- package/.claude/skills/orion/templates/project-context/assessment.md +45 -0
- package/.claude/skills/orion/templates/project-context/defects.md +5 -0
- package/.claude/skills/orion/templates/project-context/report.md +45 -0
- package/.claude/skills/orion/templates/project-context/retry-policy.md +6 -0
- package/.claude/skills/orion/templates/project-context/run.md +4 -1
- package/.claude/skills/orion/templates/project-context/test-case-map.md +5 -0
- package/.claude/skills/orion/templates/project-context/test-design.md +24 -0
- package/.claude/skills/pact/SKILL.md +2 -2
- package/.claude/skills/pact/templates/README.md +4 -2
- package/.claude/skills/pact/templates/project/package.json +2 -2
- package/.claude/skills/pact/templates/project/{data/cases.js → resources/desc/products.desc.js} +3 -3
- package/.claude/skills/pact/templates/project/resources/testData/testData.js +21 -0
- package/.claude/skills/pact/templates/project/src/config/env.js +32 -0
- package/.claude/skills/pact/templates/project/src/{products-client.js → services/products-client.js} +4 -2
- package/.claude/skills/pact/templates/project/tests/contract/products.contract.test.js +46 -0
- package/.claude/skills/pact/templates/project/{verify → tests/verify}/products.verify.js +7 -22
- package/.claude/skills/playwright/SKILL.md +6 -6
- package/.claude/skills/playwright/templates/README.md +29 -10
- package/.claude/skills/playwright/templates/ci/Jenkinsfile +1 -1
- package/.claude/skills/playwright/templates/ci/azure-pipelines.yml +1 -1
- package/.claude/skills/playwright/templates/ci/github-actions-javascript.yml +1 -1
- package/.claude/skills/playwright/templates/ci/github-actions.yml +1 -1
- package/.claude/skills/playwright/templates/ci/gitlab-ci.yml +1 -1
- package/.claude/skills/playwright/templates/dotnet/.env.example +7 -0
- package/.claude/skills/playwright/templates/dotnet/.runsettings +17 -0
- package/.claude/skills/playwright/templates/dotnet/Automation.csproj +8 -0
- package/.claude/skills/playwright/templates/dotnet/Config/Env.cs +89 -0
- package/.claude/skills/playwright/templates/dotnet/Config/Flags.cs +56 -0
- package/.claude/skills/playwright/templates/dotnet/Config/Paths.cs +31 -0
- package/.claude/skills/playwright/templates/dotnet/Fixtures/ApiBaseTest.cs +39 -0
- package/.claude/skills/playwright/templates/dotnet/Fixtures/BaseTest.cs +72 -0
- package/.claude/skills/playwright/templates/dotnet/PageObjects/BasePage.cs +63 -0
- package/.claude/skills/playwright/templates/dotnet/PageObjects/HomePage.cs +21 -0
- package/.claude/skills/playwright/templates/dotnet/PageObjects/LoginPage.cs +54 -0
- package/.claude/skills/playwright/templates/dotnet/PageObjects/ShellPage.cs +29 -0
- package/.claude/skills/playwright/templates/dotnet/Resources/Desc/SignInDesc.cs +23 -0
- package/.claude/skills/playwright/templates/dotnet/Resources/TestData/TestData.cs +74 -0
- package/.claude/skills/playwright/templates/dotnet/Resources/TestData/testData.json +19 -0
- package/.claude/skills/playwright/templates/dotnet/Services/ApiClient.cs +51 -0
- package/.claude/skills/playwright/templates/dotnet/Setup/AuthSetup.cs +63 -0
- package/.claude/skills/playwright/templates/dotnet/Tests/Api/SessionTests.cs +18 -0
- package/.claude/skills/playwright/templates/dotnet/Tests/Ui/SignInTests.cs +48 -0
- package/.claude/skills/playwright/templates/dotnet/Tests/Unit/UtilsTests.cs +40 -0
- package/.claude/skills/playwright/templates/dotnet/Utils/AutomationError.cs +15 -0
- package/.claude/skills/playwright/templates/dotnet/Utils/Dates.cs +18 -0
- package/.claude/skills/playwright/templates/dotnet/Utils/Log.cs +37 -0
- package/.claude/skills/playwright/templates/dotnet/Utils/RandomData.cs +26 -0
- package/.claude/skills/playwright/templates/dotnet/Utils/Redact.cs +22 -0
- package/.claude/skills/playwright/templates/dotnet/Utils/TestDescription.cs +55 -0
- package/.claude/skills/playwright/templates/dotnet/gitignore +6 -1
- package/.claude/skills/playwright/templates/javascript/.env.example +8 -0
- package/.claude/skills/playwright/templates/javascript/fixtures/index.js +85 -0
- package/.claude/skills/playwright/templates/javascript/fixtures/session.js +82 -0
- package/.claude/skills/playwright/templates/javascript/gitignore +7 -0
- package/.claude/skills/playwright/templates/javascript/jsconfig.json +12 -0
- package/.claude/skills/playwright/templates/javascript/package.json +7 -3
- package/.claude/skills/playwright/templates/javascript/pageObjects/basePage.js +62 -0
- package/.claude/skills/playwright/templates/javascript/pageObjects/homePage.js +19 -0
- package/.claude/skills/playwright/templates/javascript/pageObjects/loginPage.js +44 -0
- package/.claude/skills/playwright/templates/javascript/pageObjects/shellPage.js +26 -0
- package/.claude/skills/playwright/templates/javascript/playwright.config.js +45 -24
- package/.claude/skills/playwright/templates/javascript/reporters/summaryReporter.js +233 -0
- package/.claude/skills/playwright/templates/javascript/resources/desc/signIn.desc.js +33 -0
- package/.claude/skills/playwright/templates/javascript/resources/testData/testData.js +45 -0
- package/.claude/skills/playwright/templates/javascript/setup/auth.setup.js +17 -0
- package/.claude/skills/playwright/templates/javascript/setup/auth.teardown.js +16 -0
- package/.claude/skills/playwright/templates/javascript/src/config/env.js +107 -0
- package/.claude/skills/playwright/templates/javascript/src/config/flags.js +70 -0
- package/.claude/skills/playwright/templates/javascript/src/config/loadEnv.js +21 -0
- package/.claude/skills/playwright/templates/javascript/src/config/paths.js +22 -0
- package/.claude/skills/playwright/templates/javascript/src/services/apiClient.js +68 -0
- package/.claude/skills/playwright/templates/javascript/tests/api/session.spec.js +15 -0
- package/.claude/skills/playwright/templates/javascript/tests/ui/signIn.spec.js +35 -0
- package/.claude/skills/playwright/templates/javascript/tests/unit/summaryReporter.test.js +34 -0
- package/.claude/skills/playwright/templates/javascript/tests/unit/utils.test.js +31 -0
- package/.claude/skills/playwright/templates/javascript/utils/date.js +28 -0
- package/.claude/skills/playwright/templates/javascript/{src → utils}/errors.js +1 -0
- package/.claude/skills/playwright/templates/javascript/utils/formFill.js +29 -0
- package/.claude/skills/playwright/templates/javascript/utils/logger.js +33 -0
- package/.claude/skills/playwright/templates/javascript/utils/random.js +37 -0
- package/.claude/skills/playwright/templates/javascript/utils/redact.js +35 -0
- package/.claude/skills/playwright/templates/javascript/utils/titles.js +38 -0
- package/.claude/skills/playwright/templates/project/.env.example +8 -0
- package/.claude/skills/playwright/templates/project/fixtures/index.ts +86 -0
- package/.claude/skills/playwright/templates/project/fixtures/session.ts +78 -0
- package/.claude/skills/playwright/templates/project/gitignore +9 -2
- package/.claude/skills/playwright/templates/project/package.json +8 -6
- package/.claude/skills/playwright/templates/project/pageObjects/basePage.ts +57 -0
- package/.claude/skills/playwright/templates/project/pageObjects/homePage.ts +20 -0
- package/.claude/skills/playwright/templates/project/pageObjects/loginPage.ts +47 -0
- package/.claude/skills/playwright/templates/project/pageObjects/shellPage.ts +22 -0
- package/.claude/skills/playwright/templates/project/playwright.config.ts +49 -23
- package/.claude/skills/playwright/templates/project/reporters/summaryReporter.ts +241 -0
- package/.claude/skills/playwright/templates/project/resources/desc/signIn.desc.ts +32 -0
- package/.claude/skills/playwright/templates/project/resources/testData/testData.ts +42 -0
- package/.claude/skills/playwright/templates/project/setup/auth.setup.ts +16 -0
- package/.claude/skills/playwright/templates/project/setup/auth.teardown.ts +15 -0
- package/.claude/skills/playwright/templates/project/src/config/env.ts +109 -0
- package/.claude/skills/playwright/templates/project/src/config/flags.ts +70 -0
- package/.claude/skills/playwright/templates/project/src/config/loadEnv.ts +17 -0
- package/.claude/skills/playwright/templates/project/src/config/paths.ts +19 -0
- package/.claude/skills/playwright/templates/project/src/services/apiClient.ts +70 -0
- package/.claude/skills/playwright/templates/project/tests/api/session.spec.ts +14 -0
- package/.claude/skills/playwright/templates/project/tests/ui/signIn.spec.ts +34 -0
- package/.claude/skills/playwright/templates/project/tests/unit/summaryReporter.test.ts +33 -0
- package/.claude/skills/playwright/templates/project/tests/unit/utils.test.ts +30 -0
- package/.claude/skills/playwright/templates/project/tsconfig.json +3 -8
- package/.claude/skills/playwright/templates/project/utils/date.ts +25 -0
- package/.claude/skills/playwright/templates/project/utils/formFill.ts +27 -0
- package/.claude/skills/playwright/templates/project/utils/logger.ts +32 -0
- package/.claude/skills/playwright/templates/project/utils/random.ts +34 -0
- package/.claude/skills/playwright/templates/project/utils/redact.ts +32 -0
- package/.claude/skills/playwright/templates/project/utils/titles.ts +42 -0
- package/.claude/skills/playwright/templates/python/.env.example +8 -0
- package/.claude/skills/playwright/templates/python/conftest.py +91 -16
- package/.claude/skills/playwright/templates/python/gitignore +5 -0
- package/.claude/skills/playwright/templates/python/page_objects/__init__.py +1 -0
- package/.claude/skills/playwright/templates/python/page_objects/base_page.py +57 -0
- package/.claude/skills/playwright/templates/python/page_objects/home_page.py +22 -0
- package/.claude/skills/playwright/templates/python/page_objects/login_page.py +42 -0
- package/.claude/skills/playwright/templates/python/page_objects/shell_page.py +21 -0
- package/.claude/skills/playwright/templates/python/pytest.ini +5 -2
- package/.claude/skills/playwright/templates/python/requirements.txt +1 -0
- package/.claude/skills/playwright/templates/python/resources/__init__.py +1 -0
- package/.claude/skills/playwright/templates/python/resources/desc/__init__.py +1 -0
- package/.claude/skills/playwright/templates/python/resources/desc/sign_in_desc.py +27 -0
- package/.claude/skills/playwright/templates/python/resources/test_data/__init__.py +1 -0
- package/.claude/skills/playwright/templates/python/resources/test_data/test_data.py +41 -0
- package/.claude/skills/playwright/templates/python/setup/__init__.py +1 -0
- package/.claude/skills/playwright/templates/python/setup/auth.py +53 -0
- package/.claude/skills/playwright/templates/python/src/__init__.py +1 -0
- package/.claude/skills/playwright/templates/python/src/config/__init__.py +1 -0
- package/.claude/skills/playwright/templates/python/src/config/env.py +109 -0
- package/.claude/skills/playwright/templates/python/src/config/flags.py +63 -0
- package/.claude/skills/playwright/templates/python/src/config/load_env.py +16 -0
- package/.claude/skills/playwright/templates/python/src/config/paths.py +25 -0
- package/.claude/skills/playwright/templates/python/src/services/__init__.py +1 -0
- package/.claude/skills/playwright/templates/python/src/services/api_client.py +60 -0
- package/.claude/skills/playwright/templates/python/tests/api/test_session.py +14 -0
- package/.claude/skills/playwright/templates/python/tests/ui/test_sign_in.py +36 -0
- package/.claude/skills/playwright/templates/python/tests/unit/test_utils.py +32 -0
- package/.claude/skills/playwright/templates/python/utils/__init__.py +1 -0
- package/.claude/skills/playwright/templates/python/utils/dates.py +23 -0
- package/.claude/skills/playwright/templates/python/{framework → utils}/errors.py +3 -2
- package/.claude/skills/playwright/templates/python/utils/form_fill.py +26 -0
- package/.claude/skills/playwright/templates/python/utils/logger.py +40 -0
- package/.claude/skills/playwright/templates/python/utils/markers.py +6 -0
- package/.claude/skills/playwright/templates/python/utils/random_data.py +35 -0
- package/.claude/skills/playwright/templates/python/utils/redact.py +30 -0
- package/.claude/skills/playwright/templates/python/utils/titles.py +53 -0
- package/.claude/skills/quality-checks/SKILL.md +11 -11
- package/.claude/skills/quality-checks/templates/README.md +14 -12
- package/.claude/skills/quality-checks/templates/playwright-js/pageObjects/scannedPage.js +21 -0
- package/.claude/skills/quality-checks/templates/playwright-js/resources/desc/quality.desc.js +63 -0
- package/.claude/skills/quality-checks/templates/playwright-js/resources/testData/qualityData.js +32 -0
- package/.claude/skills/quality-checks/templates/playwright-js/src/checks/accessibility.js +50 -0
- package/.claude/skills/quality-checks/templates/playwright-js/src/checks/pageHealth.js +38 -0
- package/.claude/skills/quality-checks/templates/playwright-js/src/checks/performance.js +21 -0
- package/.claude/skills/quality-checks/templates/playwright-js/src/services/graphqlClient.js +28 -0
- package/.claude/skills/quality-checks/templates/playwright-js/tests/api/graphql.spec.js +23 -0
- package/.claude/skills/quality-checks/templates/playwright-js/tests/ui/quality.spec.js +50 -0
- package/.claude/skills/quality-checks/templates/playwright-ts/pageObjects/scannedPage.ts +20 -0
- package/.claude/skills/quality-checks/templates/playwright-ts/resources/desc/quality.desc.ts +59 -0
- package/.claude/skills/quality-checks/templates/playwright-ts/{src/data/quality.data.ts → resources/testData/qualityData.ts} +3 -2
- package/.claude/skills/quality-checks/templates/playwright-ts/tests/api/graphql.spec.ts +22 -0
- package/.claude/skills/quality-checks/templates/playwright-ts/tests/ui/quality.spec.ts +49 -0
- package/.claude/skills/requests/templates/README.md +6 -7
- package/.claude/skills/requests/templates/python-pytest/.env.example +4 -0
- package/.claude/skills/requests/templates/python-pytest/conftest.py +24 -9
- package/.claude/skills/requests/templates/python-pytest/pytest.ini +6 -3
- package/.claude/skills/requests/templates/python-pytest/requirements.txt +1 -0
- package/.claude/skills/requests/templates/python-pytest/resources/__init__.py +1 -0
- package/.claude/skills/requests/templates/python-pytest/resources/desc/__init__.py +1 -0
- package/.claude/skills/requests/templates/python-pytest/resources/desc/products_desc.py +27 -0
- package/.claude/skills/requests/templates/python-pytest/resources/test_data/__init__.py +1 -0
- package/.claude/skills/requests/templates/python-pytest/resources/test_data/test_data.py +27 -0
- package/.claude/skills/requests/templates/python-pytest/src/__init__.py +1 -0
- package/.claude/skills/requests/templates/python-pytest/src/config/__init__.py +1 -0
- package/.claude/skills/requests/templates/python-pytest/src/config/env.py +39 -0
- package/.claude/skills/requests/templates/python-pytest/src/config/flags.py +35 -0
- package/.claude/skills/requests/templates/python-pytest/src/config/load_env.py +16 -0
- package/.claude/skills/requests/templates/python-pytest/src/config/paths.py +16 -0
- package/.claude/skills/requests/templates/python-pytest/src/services/__init__.py +1 -0
- package/.claude/skills/requests/templates/python-pytest/{api/client.py → src/services/api_client.py} +19 -10
- package/.claude/skills/requests/templates/python-pytest/{api → src/services}/products_api.py +3 -9
- package/.claude/skills/requests/templates/python-pytest/tests/api/test_products.py +35 -0
- package/.claude/skills/requests/templates/python-pytest/tests/unit/test_utils.py +32 -0
- package/.claude/skills/requests/templates/python-pytest/utils/__init__.py +1 -0
- package/.claude/skills/requests/templates/python-pytest/utils/dates.py +23 -0
- package/.claude/skills/{selenium/templates/python-pytest/framework → requests/templates/python-pytest/utils}/errors.py +4 -3
- package/.claude/skills/requests/templates/python-pytest/utils/logger.py +40 -0
- package/.claude/skills/requests/templates/python-pytest/utils/random_data.py +35 -0
- package/.claude/skills/requests/templates/python-pytest/utils/redact.py +30 -0
- package/.claude/skills/requests/templates/python-pytest/utils/titles.py +53 -0
- package/.claude/skills/requirement-analysis/SKILL.md +1 -1
- package/.claude/skills/rest-assured/SKILL.md +1 -1
- package/.claude/skills/rest-assured/templates/README.md +6 -7
- package/.claude/skills/rest-assured/templates/ci/github-actions.yml +5 -2
- package/.claude/skills/rest-assured/templates/java-testng/.env.example +3 -0
- package/.claude/skills/rest-assured/templates/java-testng/pom.xml +7 -0
- package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/{api/ApiConfig.java → config/Env.java} +35 -22
- package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/config/Flags.java +17 -0
- package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/config/Paths.java +14 -0
- package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/desc/ProductsDesc.java +26 -0
- package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/fixtures/BaseTest.java +29 -0
- package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/services/ApiSpec.java +31 -0
- package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/services/HealthApi.java +17 -0
- package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/{api → services}/ProductsApi.java +19 -14
- package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/{data → testData}/ProductBuilder.java +4 -8
- package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/testData/TestData.java +64 -0
- package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/tests/api/ProductsTest.java +49 -0
- package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/tests/unit/UtilsTest.java +34 -0
- package/.claude/skills/{selenium/templates/java-testng/src/test/java/automation/framework → rest-assured/templates/java-testng/src/test/java/automation/utils}/AutomationError.java +4 -4
- package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/utils/Case.java +20 -0
- package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/utils/CaseTransformer.java +54 -0
- package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/utils/Dates.java +42 -0
- package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/utils/Log.java +45 -0
- package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/utils/MissingSettingError.java +13 -0
- package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/utils/RandomData.java +41 -0
- package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/utils/Redact.java +33 -0
- package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/utils/TestDescription.java +25 -0
- package/.claude/skills/rest-assured/templates/java-testng/src/test/resources/testData/testData.properties +14 -0
- package/.claude/skills/rest-assured/templates/java-testng/testng.xml +14 -0
- package/.claude/skills/selenium/SKILL.md +1 -1
- package/.claude/skills/selenium/templates/README.md +25 -13
- package/.claude/skills/selenium/templates/ci/github-actions-java.yml +5 -2
- package/.claude/skills/selenium/templates/csharp-nunit/.env.example +15 -0
- package/.claude/skills/selenium/templates/csharp-nunit/Automation.csproj +7 -0
- package/.claude/skills/selenium/templates/csharp-nunit/{Framework/Config.cs → Config/Env.cs} +33 -34
- package/.claude/skills/selenium/templates/csharp-nunit/Config/Flags.cs +39 -0
- package/.claude/skills/selenium/templates/csharp-nunit/Config/Paths.cs +31 -0
- package/.claude/skills/selenium/templates/csharp-nunit/{Framework → Driver}/DriverFactory.cs +16 -13
- package/.claude/skills/selenium/templates/csharp-nunit/Driver/DriverManager.cs +27 -0
- package/.claude/skills/selenium/templates/csharp-nunit/Fixtures/BaseTest.cs +56 -0
- package/.claude/skills/selenium/templates/csharp-nunit/{Pages → PageObjects}/BasePage.cs +44 -14
- package/.claude/skills/selenium/templates/csharp-nunit/PageObjects/HomePage.cs +21 -0
- package/.claude/skills/selenium/templates/csharp-nunit/PageObjects/LoginPage.cs +53 -0
- package/.claude/skills/selenium/templates/csharp-nunit/PageObjects/ShellPage.cs +22 -0
- package/.claude/skills/selenium/templates/csharp-nunit/Resources/Desc/SignInDesc.cs +23 -0
- package/.claude/skills/selenium/templates/csharp-nunit/Resources/TestData/TestData.cs +74 -0
- package/.claude/skills/selenium/templates/csharp-nunit/Resources/TestData/testData.json +14 -0
- package/.claude/skills/selenium/templates/csharp-nunit/Services/ApiClient.cs +71 -0
- package/.claude/skills/selenium/templates/csharp-nunit/Setup/AuthSetup.cs +104 -0
- package/.claude/skills/selenium/templates/csharp-nunit/Tests/Api/SessionTests.cs +23 -0
- package/.claude/skills/selenium/templates/csharp-nunit/Tests/Ui/SignInTests.cs +42 -0
- package/.claude/skills/selenium/templates/csharp-nunit/Tests/Unit/UtilsTests.cs +40 -0
- package/.claude/skills/selenium/templates/csharp-nunit/Utils/AutomationError.cs +15 -0
- package/.claude/skills/selenium/templates/csharp-nunit/Utils/Dates.cs +18 -0
- package/.claude/skills/selenium/templates/csharp-nunit/Utils/FormFill.cs +20 -0
- package/.claude/skills/selenium/templates/csharp-nunit/Utils/Log.cs +37 -0
- package/.claude/skills/selenium/templates/csharp-nunit/Utils/RandomData.cs +26 -0
- package/.claude/skills/selenium/templates/csharp-nunit/Utils/Redact.cs +22 -0
- package/.claude/skills/selenium/templates/csharp-nunit/Utils/TestDescription.cs +55 -0
- package/.claude/skills/selenium/templates/csharp-nunit/gitignore +6 -2
- package/.claude/skills/selenium/templates/java-testng/.env.example +12 -0
- package/.claude/skills/selenium/templates/java-testng/gitignore +5 -2
- package/.claude/skills/selenium/templates/java-testng/pom.xml +2 -0
- package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/{framework/Config.java → config/Env.java} +45 -55
- package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/config/Flags.java +50 -0
- package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/config/Paths.java +20 -0
- package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/desc/SignInDesc.java +30 -0
- package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/{framework → driver}/DriverFactory.java +15 -12
- package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/{framework → driver}/DriverManager.java +4 -7
- package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/fixtures/BaseTest.java +87 -0
- package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/{pages → pageObjects}/BasePage.java +41 -17
- package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/pageObjects/HomePage.java +32 -0
- package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/pageObjects/LoginPage.java +69 -0
- package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/pageObjects/ShellPage.java +34 -0
- package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/services/ApiClient.java +93 -0
- package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/setup/AuthSetup.java +125 -0
- package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/testData/TestData.java +88 -0
- package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/tests/api/SessionTest.java +23 -0
- package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/tests/ui/SignInTest.java +46 -0
- package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/tests/unit/UtilsTest.java +34 -0
- package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/utils/AutomationError.java +18 -0
- package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/utils/Case.java +20 -0
- package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/utils/CaseTransformer.java +54 -0
- package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/utils/Dates.java +42 -0
- package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/utils/FormFill.java +25 -0
- package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/utils/Log.java +45 -0
- package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/utils/MissingSettingError.java +13 -0
- package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/utils/RandomData.java +41 -0
- package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/utils/Redact.java +33 -0
- package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/utils/TestDescription.java +25 -0
- package/.claude/skills/selenium/templates/java-testng/src/test/resources/testData/testData.properties +11 -0
- package/.claude/skills/selenium/templates/java-testng/testng.xml +15 -5
- package/.claude/skills/selenium/templates/python-pytest/.env.example +12 -0
- package/.claude/skills/selenium/templates/python-pytest/conftest.py +63 -12
- package/.claude/skills/selenium/templates/python-pytest/gitignore +7 -2
- package/.claude/skills/selenium/templates/python-pytest/page_objects/__init__.py +1 -0
- package/.claude/skills/selenium/templates/python-pytest/{pages → page_objects}/base_page.py +20 -20
- package/.claude/skills/selenium/templates/python-pytest/page_objects/home_page.py +17 -0
- package/.claude/skills/selenium/templates/python-pytest/{pages → page_objects}/login_page.py +12 -14
- package/.claude/skills/selenium/templates/python-pytest/page_objects/shell_page.py +16 -0
- package/.claude/skills/selenium/templates/python-pytest/pytest.ini +6 -2
- package/.claude/skills/selenium/templates/python-pytest/requirements.txt +1 -0
- package/.claude/skills/selenium/templates/python-pytest/resources/__init__.py +1 -0
- package/.claude/skills/selenium/templates/python-pytest/resources/desc/__init__.py +1 -0
- package/.claude/skills/selenium/templates/python-pytest/resources/desc/sign_in_desc.py +27 -0
- package/.claude/skills/selenium/templates/python-pytest/resources/test_data/__init__.py +1 -0
- package/.claude/skills/selenium/templates/python-pytest/resources/test_data/test_data.py +25 -0
- package/.claude/skills/selenium/templates/python-pytest/setup/__init__.py +1 -0
- package/.claude/skills/selenium/templates/python-pytest/setup/auth.py +60 -0
- package/.claude/skills/selenium/templates/python-pytest/src/__init__.py +1 -0
- package/.claude/skills/selenium/templates/python-pytest/src/config/__init__.py +1 -0
- package/.claude/skills/selenium/templates/python-pytest/src/config/env.py +68 -0
- package/.claude/skills/selenium/templates/python-pytest/src/config/flags.py +40 -0
- package/.claude/skills/selenium/templates/python-pytest/src/config/load_env.py +16 -0
- package/.claude/skills/selenium/templates/python-pytest/src/config/paths.py +25 -0
- package/.claude/skills/selenium/templates/python-pytest/src/driver/__init__.py +1 -0
- package/.claude/skills/selenium/templates/python-pytest/{framework → src/driver}/driver_factory.py +11 -18
- package/.claude/skills/selenium/templates/python-pytest/{framework → src/driver}/driver_manager.py +3 -3
- package/.claude/skills/selenium/templates/python-pytest/src/services/__init__.py +1 -0
- package/.claude/skills/selenium/templates/python-pytest/src/services/api_client.py +89 -0
- package/.claude/skills/selenium/templates/python-pytest/tests/api/test_session.py +11 -0
- package/.claude/skills/selenium/templates/python-pytest/tests/ui/test_sign_in.py +34 -0
- package/.claude/skills/selenium/templates/python-pytest/tests/unit/test_utils.py +32 -0
- package/.claude/skills/selenium/templates/python-pytest/utils/__init__.py +1 -0
- package/.claude/skills/selenium/templates/python-pytest/utils/dates.py +23 -0
- package/.claude/skills/selenium/templates/python-pytest/utils/errors.py +28 -0
- package/.claude/skills/selenium/templates/python-pytest/utils/form_fill.py +29 -0
- package/.claude/skills/selenium/templates/python-pytest/utils/logger.py +40 -0
- package/.claude/skills/selenium/templates/python-pytest/utils/markers.py +6 -0
- package/.claude/skills/selenium/templates/python-pytest/utils/random_data.py +35 -0
- package/.claude/skills/selenium/templates/python-pytest/utils/redact.py +30 -0
- package/.claude/skills/selenium/templates/python-pytest/utils/titles.py +53 -0
- package/.claude/skills/self-healing/SKILL.md +2 -2
- package/.claude/skills/test-design/SKILL.md +1 -1
- package/.claude/skills/test-reporting/references/tool-mapping.md +13 -9
- package/.claude/skills/ui-observation/SKILL.md +8 -6
- package/.claude/skills/ui-observation/references/login-methods.md +1 -1
- package/.claude-plugin/plugin.json +15 -2
- package/.codex/agents/automation-strategist.toml +1 -0
- package/.codex/agents/change-agent.toml +1 -0
- package/.codex/agents/codebase-analyst.toml +1 -0
- package/.codex/agents/environment-discovery.toml +1 -0
- package/.codex/agents/evidence-validator.toml +1 -0
- package/.codex/agents/executor.toml +1 -0
- package/.codex/agents/failure-analyst.toml +1 -0
- package/.codex/agents/implementer.toml +2 -1
- package/.codex/agents/requirement-analyst.toml +1 -0
- package/.codex/agents/reviewer.toml +1 -0
- package/.codex/agents/test-reporter.toml +1 -0
- package/.codex/hooks.json +15 -0
- package/.cursor/commands/orion.md +1 -1
- package/.cursor/hooks.json +10 -0
- package/.devin/hooks.v1.json +13 -0
- package/.gemini/agents/automation-strategist.md +1 -0
- package/.gemini/agents/change-agent.md +1 -0
- package/.gemini/agents/codebase-analyst.md +1 -0
- package/.gemini/agents/environment-discovery.md +1 -0
- package/.gemini/agents/evidence-validator.md +1 -0
- package/.gemini/agents/executor.md +1 -0
- package/.gemini/agents/failure-analyst.md +1 -0
- package/.gemini/agents/implementer.md +2 -1
- package/.gemini/agents/requirement-analyst.md +1 -0
- package/.gemini/agents/reviewer.md +1 -0
- package/.gemini/agents/test-reporter.md +1 -0
- package/.gemini/commands/orion.toml +2 -2
- package/.github/hooks/orion-lean.json +13 -0
- package/.github/prompts/orion.prompt.md +2 -2
- package/.windsurf/workflows/orion.md +2 -2
- package/AGENTS.md +6 -6
- package/README.md +55 -140
- package/assets/architecture.svg +104 -0
- package/assets/run-flow.svg +1 -1
- package/bin/orion.mjs +6 -6
- package/hosts/gemini-extension/gemini-extension.json +1 -1
- package/hosts/gemini-extension/hooks/hooks.json +16 -0
- package/hosts/gemini-extension/policies/platform.toml +5 -0
- package/package.json +6 -1
- package/.claude/skills/appium/templates/project-java/src/test/java/automation/data/Cases.java +0 -37
- package/.claude/skills/appium/templates/project-java/src/test/java/automation/data/SignInData.java +0 -25
- package/.claude/skills/appium/templates/project-java/src/test/java/automation/flows/SignInFlow.java +0 -34
- package/.claude/skills/appium/templates/project-java/src/test/java/automation/framework/Account.java +0 -19
- package/.claude/skills/appium/templates/project-java/src/test/java/automation/screens/HomeScreen.java +0 -36
- package/.claude/skills/appium/templates/project-java/src/test/java/automation/screens/LoginScreen.java +0 -57
- package/.claude/skills/appium/templates/project-java/src/test/java/automation/tests/BaseTest.java +0 -33
- package/.claude/skills/appium/templates/project-java/src/test/java/automation/tests/SmokeTest.java +0 -17
- package/.claude/skills/httpclient/templates/csharp-nunit/Api/ApiClient.cs +0 -61
- package/.claude/skills/httpclient/templates/csharp-nunit/Api/ApiConfig.cs +0 -61
- package/.claude/skills/httpclient/templates/csharp-nunit/Api/ApiError.cs +0 -17
- package/.claude/skills/httpclient/templates/csharp-nunit/Data/Cases.cs +0 -41
- package/.claude/skills/httpclient/templates/csharp-nunit/Data/HealthData.cs +0 -11
- package/.claude/skills/httpclient/templates/csharp-nunit/Data/ProductBuilder.cs +0 -16
- package/.claude/skills/httpclient/templates/csharp-nunit/Data/ProductsData.cs +0 -17
- package/.claude/skills/httpclient/templates/csharp-nunit/Tests/HealthTests.cs +0 -18
- package/.claude/skills/httpclient/templates/csharp-nunit/Tests/ProductsTests.cs +0 -48
- package/.claude/skills/k6/templates/project/data/builders.js +0 -8
- package/.claude/skills/karate/templates/java-junit5/src/test/java/api/products.feature +0 -33
- package/.claude/skills/pact/templates/project/test/contract/products.contract.test.js +0 -45
- package/.claude/skills/playwright/templates/dotnet/Components/AccountMenu.cs +0 -23
- package/.claude/skills/playwright/templates/dotnet/Data/Cases.cs +0 -43
- package/.claude/skills/playwright/templates/dotnet/Data/SignInData.cs +0 -24
- package/.claude/skills/playwright/templates/dotnet/Flows/SignInFlow.cs +0 -51
- package/.claude/skills/playwright/templates/dotnet/Framework/AutomationError.cs +0 -17
- package/.claude/skills/playwright/templates/dotnet/Framework/Config.cs +0 -91
- package/.claude/skills/playwright/templates/dotnet/Pages/BasePage.cs +0 -57
- package/.claude/skills/playwright/templates/dotnet/Pages/HomePage.cs +0 -26
- package/.claude/skills/playwright/templates/dotnet/Pages/LoginPage.cs +0 -45
- package/.claude/skills/playwright/templates/dotnet/Tests/SmokeTests.cs +0 -47
- package/.claude/skills/playwright/templates/javascript/src/components/account-menu.component.js +0 -30
- package/.claude/skills/playwright/templates/javascript/src/config.js +0 -53
- package/.claude/skills/playwright/templates/javascript/src/data/accounts.js +0 -23
- package/.claude/skills/playwright/templates/javascript/src/data/cases.js +0 -49
- package/.claude/skills/playwright/templates/javascript/src/data/sign-in.data.js +0 -12
- package/.claude/skills/playwright/templates/javascript/src/flows/sign-in.flow.js +0 -53
- package/.claude/skills/playwright/templates/javascript/src/pages/base.page.js +0 -59
- package/.claude/skills/playwright/templates/javascript/src/pages/home.page.js +0 -31
- package/.claude/skills/playwright/templates/javascript/src/pages/login.page.js +0 -56
- package/.claude/skills/playwright/templates/javascript/tests/fixtures.js +0 -20
- package/.claude/skills/playwright/templates/javascript/tests/smoke.spec.js +0 -22
- package/.claude/skills/playwright/templates/project/src/components/account-menu.component.ts +0 -27
- package/.claude/skills/playwright/templates/project/src/config.ts +0 -56
- package/.claude/skills/playwright/templates/project/src/data/accounts.ts +0 -21
- package/.claude/skills/playwright/templates/project/src/data/cases.ts +0 -55
- package/.claude/skills/playwright/templates/project/src/data/sign-in.data.ts +0 -10
- package/.claude/skills/playwright/templates/project/src/flows/sign-in.flow.ts +0 -51
- package/.claude/skills/playwright/templates/project/src/pages/base.page.ts +0 -52
- package/.claude/skills/playwright/templates/project/src/pages/home.page.ts +0 -30
- package/.claude/skills/playwright/templates/project/src/pages/login.page.ts +0 -53
- package/.claude/skills/playwright/templates/project/tests/fixtures.ts +0 -25
- package/.claude/skills/playwright/templates/project/tests/smoke.spec.ts +0 -22
- package/.claude/skills/playwright/templates/python/components/__init__.py +0 -1
- package/.claude/skills/playwright/templates/python/components/account_menu.py +0 -22
- package/.claude/skills/playwright/templates/python/data/accounts.py +0 -14
- package/.claude/skills/playwright/templates/python/data/cases.py +0 -33
- package/.claude/skills/playwright/templates/python/data/sign_in_data.py +0 -9
- package/.claude/skills/playwright/templates/python/flows/sign_in.py +0 -63
- package/.claude/skills/playwright/templates/python/framework/config.py +0 -86
- package/.claude/skills/playwright/templates/python/pages/base_page.py +0 -51
- package/.claude/skills/playwright/templates/python/pages/home_page.py +0 -21
- package/.claude/skills/playwright/templates/python/pages/login_page.py +0 -40
- package/.claude/skills/playwright/templates/python/tests/test_smoke.py +0 -26
- package/.claude/skills/quality-checks/templates/playwright-ts/src/pages/scanned.page.ts +0 -16
- package/.claude/skills/quality-checks/templates/playwright-ts/tests/quality.spec.ts +0 -58
- package/.claude/skills/requests/templates/python-pytest/api/config.py +0 -43
- package/.claude/skills/requests/templates/python-pytest/api/errors.py +0 -15
- package/.claude/skills/requests/templates/python-pytest/data/builders.py +0 -16
- package/.claude/skills/requests/templates/python-pytest/data/cases.py +0 -30
- package/.claude/skills/requests/templates/python-pytest/data/health_data.py +0 -6
- package/.claude/skills/requests/templates/python-pytest/data/products_data.py +0 -10
- package/.claude/skills/requests/templates/python-pytest/tests/test_health.py +0 -12
- package/.claude/skills/requests/templates/python-pytest/tests/test_products.py +0 -25
- package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/api/ApiError.java +0 -18
- package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/api/ApiSpec.java +0 -29
- package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/api/HealthApi.java +0 -21
- package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/data/Cases.java +0 -45
- package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/data/HealthData.java +0 -12
- package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/data/ProductsData.java +0 -16
- package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/tests/HealthTest.java +0 -15
- package/.claude/skills/rest-assured/templates/java-testng/src/test/java/automation/tests/ProductsTest.java +0 -37
- package/.claude/skills/selenium/templates/csharp-nunit/Components/AccountMenu.cs +0 -26
- package/.claude/skills/selenium/templates/csharp-nunit/Data/Cases.cs +0 -43
- package/.claude/skills/selenium/templates/csharp-nunit/Data/SignInData.cs +0 -24
- package/.claude/skills/selenium/templates/csharp-nunit/Flows/SignInFlow.cs +0 -51
- package/.claude/skills/selenium/templates/csharp-nunit/Framework/AutomationError.cs +0 -17
- package/.claude/skills/selenium/templates/csharp-nunit/Framework/DriverManager.cs +0 -26
- package/.claude/skills/selenium/templates/csharp-nunit/Pages/HomePage.cs +0 -28
- package/.claude/skills/selenium/templates/csharp-nunit/Pages/LoginPage.cs +0 -58
- package/.claude/skills/selenium/templates/csharp-nunit/Tests/BaseTest.cs +0 -22
- package/.claude/skills/selenium/templates/csharp-nunit/Tests/SmokeTests.cs +0 -37
- package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/components/AccountMenu.java +0 -37
- package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/data/Cases.java +0 -48
- package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/data/SignInData.java +0 -36
- package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/flows/SignInFlow.java +0 -60
- package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/framework/Account.java +0 -19
- package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/pages/HomePage.java +0 -45
- package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/pages/LoginPage.java +0 -78
- package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/tests/BaseTest.java +0 -33
- package/.claude/skills/selenium/templates/java-testng/src/test/java/automation/tests/SmokeTest.java +0 -33
- package/.claude/skills/selenium/templates/python-pytest/components/__init__.py +0 -1
- package/.claude/skills/selenium/templates/python-pytest/components/account_menu.py +0 -19
- package/.claude/skills/selenium/templates/python-pytest/data/accounts.py +0 -14
- package/.claude/skills/selenium/templates/python-pytest/data/cases.py +0 -33
- package/.claude/skills/selenium/templates/python-pytest/data/sign_in_data.py +0 -9
- package/.claude/skills/selenium/templates/python-pytest/flows/__init__.py +0 -0
- package/.claude/skills/selenium/templates/python-pytest/flows/sign_in.py +0 -61
- package/.claude/skills/selenium/templates/python-pytest/framework/__init__.py +0 -0
- package/.claude/skills/selenium/templates/python-pytest/framework/config.py +0 -90
- package/.claude/skills/selenium/templates/python-pytest/pages/__init__.py +0 -0
- package/.claude/skills/selenium/templates/python-pytest/pages/home_page.py +0 -23
- package/.claude/skills/selenium/templates/python-pytest/tests/test_smoke.py +0 -25
- /package/.claude/skills/karate/templates/java-junit5/src/test/java/{api → tests/api}/delete-product.feature +0 -0
- /package/.claude/skills/playwright/templates/{python/data/__init__.py → dotnet/auth/.gitkeep} +0 -0
- /package/.claude/skills/playwright/templates/{python/flows/__init__.py → javascript/auth/.gitkeep} +0 -0
- /package/.claude/skills/playwright/templates/{python/framework/__init__.py → project/auth/.gitkeep} +0 -0
- /package/.claude/skills/playwright/templates/project/{src → utils}/errors.ts +0 -0
- /package/.claude/skills/playwright/templates/python/{pages/__init__.py → auth/.gitkeep} +0 -0
- /package/.claude/skills/quality-checks/templates/playwright-ts/src/checks/{page-health.ts → pageHealth.ts} +0 -0
- /package/.claude/skills/quality-checks/templates/playwright-ts/src/{api/graphql.ts → services/graphqlClient.ts} +0 -0
- /package/.claude/skills/{requests/templates/python-pytest/api/__init__.py → selenium/templates/csharp-nunit/auth/.gitkeep} +0 -0
- /package/.claude/skills/{requests/templates/python-pytest/data/__init__.py → selenium/templates/java-testng/auth/.gitkeep} +0 -0
- /package/.claude/skills/selenium/templates/python-pytest/{data/__init__.py → auth/.gitkeep} +0 -0
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Code map: one compact line per file with its classes, functions, methods, page-object fields and test titles, each
|
|
4
|
+
* with its line number, so an agent learns what a suite has without reading its files whole. In measured runs, dumping
|
|
5
|
+
* the suite's own files in a loop was 16 KB of one turn's output, re-read on every later turn
|
|
6
|
+
* (evals/workflows/runs/2026-11-18-cost-breakdown.md). Orion's own version of the "code knowledge graph" idea: no
|
|
7
|
+
* install, no model call. Open a file only to change it, at the line the map gives.
|
|
8
|
+
*
|
|
9
|
+
* Usage (from the workspace root):
|
|
10
|
+
* node .claude/skills/orion/scripts/codemap.mjs <suite folder> [--find <name>] [--max-bytes 6000] [--out <file>]
|
|
11
|
+
* --find only the lines whose file, class, function or test title holds <name> (case-insensitive)
|
|
12
|
+
* --out also write the full map to that file (e.g. project-context/graph/codemap.md); without it nothing is written,
|
|
13
|
+
* so read-only agents can run it
|
|
14
|
+
* Languages: JavaScript, TypeScript, Python, Java, C#, Kotlin; Gherkin feature and scenario names. Regular
|
|
15
|
+
* expressions, not a parser: it lists what a line declares, and the source stays the truth.
|
|
16
|
+
* Exit code: 0 printed · 1 nothing found · 2 wrong arguments.
|
|
17
|
+
*/
|
|
18
|
+
import fs from 'node:fs';
|
|
19
|
+
import path from 'node:path';
|
|
20
|
+
import { pathToFileURL } from 'node:url';
|
|
21
|
+
|
|
22
|
+
const SKIP = new Set(['node_modules', '.git', 'auth', 'playwright-report', 'test-results', 'allure-results', 'blob-report', 'bin',
|
|
23
|
+
'obj', 'target', 'reports', 'TestResults', '.venv', 'venv', '__pycache__', '.pytest_cache', 'test-output', 'dist', 'build',
|
|
24
|
+
'.gradle', '.idea', '.vscode', 'coverage', 'screenshots', 'videos', 'downloads', 'test-summary']);
|
|
25
|
+
const SKIP_TOP = new Set(['.claude', 'registry', '.cursor', '.cursor-plugin', '.gemini', '.codex', '.windsurf', 'project-context', '.ui-map']);
|
|
26
|
+
const EXT = /\.(m?[jt]sx?|cjs|py|java|kt|cs|feature)$/;
|
|
27
|
+
const KW = new Set(['if', 'for', 'while', 'switch', 'catch', 'return', 'function', 'new', 'else', 'using', 'lock', 'foreach', 'await',
|
|
28
|
+
'throw', 'typeof', 'super', 'this', 'synchronized', 'try', 'do', 'base', 'get', 'set', 'static', 'async', 'expect', 'test',
|
|
29
|
+
'describe', 'it', 'require', 'import', 'export', 'const', 'let', 'var', 'and', 'or', 'not', 'in', 'is', 'print', 'assert']);
|
|
30
|
+
|
|
31
|
+
function files(root) {
|
|
32
|
+
const out = [];
|
|
33
|
+
const walk = (d) => {
|
|
34
|
+
for (const e of fs.readdirSync(d, { withFileTypes: true })) {
|
|
35
|
+
const p = path.join(d, e.name);
|
|
36
|
+
if (e.isDirectory()) { if (!SKIP.has(e.name) && !(d === root && SKIP_TOP.has(e.name)) && !e.name.startsWith('.')) walk(p); }
|
|
37
|
+
else if (EXT.test(e.name) && !/\.(d\.ts|min\.js)$/.test(e.name) && fs.statSync(p).size < 400 * 1024) out.push(p);
|
|
38
|
+
}
|
|
39
|
+
};
|
|
40
|
+
walk(root);
|
|
41
|
+
return out.sort();
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/** What one file declares, as short items with line numbers. */
|
|
45
|
+
export function declarations(text, file) {
|
|
46
|
+
const items = [];
|
|
47
|
+
const lines = text.split('\n');
|
|
48
|
+
const js = /\.(m?[jt]sx?|cjs)$/.test(file), py = /\.py$/.test(file), jv = /\.(java|kt|cs)$/.test(file), gh = /\.feature$/.test(file);
|
|
49
|
+
lines.forEach((l, i) => {
|
|
50
|
+
const n = i + 1;
|
|
51
|
+
let m;
|
|
52
|
+
if (js) {
|
|
53
|
+
if ((m = l.match(/^\s*(?:export\s+(?:default\s+)?)?(?:abstract\s+)?class\s+(\w+)(?:\s+extends\s+(\w+))?/))) items.push(`class ${m[1]}${m[2] ? `<${m[2]}` : ''} :${n}`);
|
|
54
|
+
else if ((m = l.match(/^\s*(?:export\s+)?(?:async\s+)?function\s*\*?\s*(\w+)\s*\(([^)]*)\)/))) items.push(`${m[1]}(${m[2].replace(/\s+/g, ' ').slice(0, 40)}) :${n}`);
|
|
55
|
+
else if ((m = l.match(/^\s*(?:export\s+)?const\s+(\w+)\s*=\s*(?:async\s*)?(?:\(([^)]*)\)|(\w+))\s*=>/))) items.push(`${m[1]}(${(m[2] ?? m[3] ?? '').replace(/\s+/g, ' ').slice(0, 40)}) :${n}`);
|
|
56
|
+
else if ((m = l.match(/^\s{2,}(?:public\s+|private\s+|protected\s+|static\s+|readonly\s+)*(?:async\s+)?(\w+)\s*\(([^)]*)\)\s*(?::\s*[^{]+)?\{\s*$/)) && !KW.has(m[1])) items.push(`${m[1]}(${m[2].replace(/\s+/g, ' ').slice(0, 40)}) :${n}`);
|
|
57
|
+
else if ((m = l.match(/^\s+this\.(\w+)\s*=\s*(?:this\.)?page\.(\w+)/))) items.push(`.${m[1]}=${m[2]} :${n}`);
|
|
58
|
+
else if ((m = l.match(/^\s*(?:readonly\s+)?(\w+)\s*=\s*(?:this\.)?page\.(locator|getBy\w+)/))) items.push(`.${m[1]}=${m[2]} :${n}`);
|
|
59
|
+
else if ((m = l.match(/\b(test\.describe|describe)(?:\.\w+)?\(\s*(['"`])(.+?)\2/))) items.push(`describe "${m[3].slice(0, 60)}" :${n}`);
|
|
60
|
+
else if ((m = l.match(/\b(test|it)(?:\.(?:only|skip|fixme|fail|slow))?\(\s*(['"`])(.+?)\2/))) items.push(`test "${m[3].slice(0, 70)}" :${n}`);
|
|
61
|
+
else if ((m = l.match(/\btest\(\s*titleOf\((\w+)\)/))) items.push(`test <${m[1]}> :${n}`);
|
|
62
|
+
} else if (py) {
|
|
63
|
+
if ((m = l.match(/^\s*class\s+(\w+)(?:\(([^)]*)\))?/))) items.push(`class ${m[1]}${m[2] ? `<${m[2]}` : ''} :${n}`);
|
|
64
|
+
else if ((m = l.match(/^(\s*)(?:async\s+)?def\s+(\w+)\s*\(([^)]*)\)/))) items.push(`${m[1] ? '' : ''}${m[2]}(${m[3].replace(/\s+/g, ' ').replace(/^self,?\s*/, '').slice(0, 40)}) :${n}`);
|
|
65
|
+
else if ((m = l.match(/^@pytest\.fixture/))) items.push(`@fixture :${n}`);
|
|
66
|
+
} else if (jv) {
|
|
67
|
+
if ((m = l.match(/^\s*(?:public\s+|internal\s+|abstract\s+|sealed\s+|partial\s+|static\s+)*(?:class|interface|record)\s+(\w+)/))) items.push(`class ${m[1]} :${n}`);
|
|
68
|
+
else if ((m = l.match(/^\s*(?:@Test|\[Test\]|\[Fact\]|\[TestMethod\])/))) items.push(`@test :${n}`);
|
|
69
|
+
else if ((m = l.match(/^\s*(?:public|protected|internal)\s+(?:static\s+|async\s+|override\s+|virtual\s+|final\s+)*[\w<>,\[\]? ]+?\s+(\w+)\s*\(([^)]*)\)/)) && !KW.has(m[1])) items.push(`${m[1]}(${m[2].replace(/\s+/g, ' ').slice(0, 40)}) :${n}`);
|
|
70
|
+
} else if (gh) {
|
|
71
|
+
if ((m = l.match(/^\s*(Feature|Scenario(?: Outline)?):\s*(.+)/))) items.push(`${m[1]} "${m[2].trim().slice(0, 70)}" :${n}`);
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
return items;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
function main() {
|
|
78
|
+
const argv = process.argv.slice(2);
|
|
79
|
+
const o = { maxBytes: 6000 };
|
|
80
|
+
for (let i = 0; i < argv.length; i++) {
|
|
81
|
+
if (argv[i] === '--find') o.find = argv[++i];
|
|
82
|
+
else if (argv[i] === '--max-bytes') { o.maxBytes = Number(argv[++i]); if (!(o.maxBytes > 0)) { console.log('codemap: --max-bytes needs a number of bytes'); process.exit(2); } }
|
|
83
|
+
else if (argv[i] === '--out') o.out = argv[++i];
|
|
84
|
+
else if (!o.root) o.root = argv[i];
|
|
85
|
+
else { console.log(`codemap: unknown argument ${argv[i]}`); process.exit(2); }
|
|
86
|
+
}
|
|
87
|
+
if (!o.root || !fs.existsSync(o.root)) { console.log('usage: node .claude/skills/orion/scripts/codemap.mjs <suite folder> [--find <name>] [--max-bytes 6000]'); process.exit(2); }
|
|
88
|
+
const root = path.resolve(o.root);
|
|
89
|
+
const rows = [];
|
|
90
|
+
for (const f of files(root)) {
|
|
91
|
+
const rel = path.relative(root, f).split(path.sep).join('/');
|
|
92
|
+
const items = declarations(fs.readFileSync(f, 'utf8'), f);
|
|
93
|
+
if (items.length) rows.push(`${rel}: ${items.join(' · ')}`);
|
|
94
|
+
}
|
|
95
|
+
const full = `# Code map of ${path.relative(process.cwd(), root) || '.'} (${rows.length} files; line numbers after ":")\n${rows.join('\n')}\n`;
|
|
96
|
+
let outFile = o.out || null;
|
|
97
|
+
if (outFile && !o.find) {
|
|
98
|
+
try { fs.mkdirSync(path.dirname(outFile), { recursive: true }); fs.writeFileSync(outFile, full); } catch { console.log(`codemap: could not write ${outFile}; printing only`); outFile = null; }
|
|
99
|
+
}
|
|
100
|
+
let shown = rows;
|
|
101
|
+
if (o.find) {
|
|
102
|
+
const q = o.find.toLowerCase();
|
|
103
|
+
shown = rows.map((r) => {
|
|
104
|
+
const [file, rest] = [r.slice(0, r.indexOf(': ')), r.slice(r.indexOf(': ') + 2)];
|
|
105
|
+
if (file.toLowerCase().includes(q)) return r;
|
|
106
|
+
const hits = rest.split(' · ').filter((x) => x.toLowerCase().includes(q));
|
|
107
|
+
return hits.length ? `${file}: ${hits.join(' · ')}` : null;
|
|
108
|
+
}).filter(Boolean);
|
|
109
|
+
}
|
|
110
|
+
if (!shown.length) { console.log(o.find ? `codemap: nothing named like "${o.find}"` : 'codemap: no source files found'); process.exit(1); }
|
|
111
|
+
let text = shown.join('\n');
|
|
112
|
+
if (Buffer.byteLength(text) > o.maxBytes) text = `${text.slice(0, o.maxBytes)}\n… cut at ${o.maxBytes} bytes: use --find <name>${outFile && !o.find ? ` or read ${outFile}` : ''}`;
|
|
113
|
+
console.log(`${shown.length} file(s)${outFile && !o.find ? ` · full map: ${outFile}` : ''}\n${text}`);
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) main();
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* The run's definition of done, checked by machine. The orchestrator's loop ("until COMPLETE") ends only when this
|
|
4
|
+
* exits 0; each FAIL row names the next action, which becomes the loop's next step. Gate claims were the agent's own
|
|
5
|
+
* word before this: in four rehearsals on a real site (2026-11-18), a run delivered a `npm test` that stopped at once,
|
|
6
|
+
* no run recorded its per-run results, a graph gap went unmentioned, and results ran 172–477 words against a 120 limit,
|
|
7
|
+
* while each run reported itself done.
|
|
8
|
+
*
|
|
9
|
+
* Usage (from the workspace root):
|
|
10
|
+
* node .claude/skills/orion/scripts/done_check.mjs --project <test project> --story <KEY> --run <run id>
|
|
11
|
+
* [--existing] [--base <git sha>] [--command "npm test"] [--no-run] [--results project-context/results] [--report <report.md>]
|
|
12
|
+
* [--result-text <file with the result message>] [--known-failures TS-4,TS-6] [--json]
|
|
13
|
+
* Checks (each PASS, FAIL with the next action, or SKIP with why):
|
|
14
|
+
* project suite_check.mjs reports 0 findings (placeholders, layers, scripts that name missing projects, …); for an
|
|
15
|
+
* existing suite (--existing, or when suite_check says most layers are missing) only the findings that
|
|
16
|
+
* hold for any suite count: placeholders left and scripts that name a missing project
|
|
17
|
+
* command the command the result gives the user exits 0; a failing test is allowed only when it is in
|
|
18
|
+
* --known-failures (an app defect the result reports)
|
|
19
|
+
* runs 3 or more results files for this run (results_parse.mjs output, `<run id>*.json`), and in each, every
|
|
20
|
+
* test of the story passed on its first attempt (retries off), except --known-failures
|
|
21
|
+
* coverage graph.mjs check --story finds no gap (an AC with no case, a case with no test, a test with no case)
|
|
22
|
+
* report report_check.mjs finds nothing in the report
|
|
23
|
+
* result the result message: no table, at most 120 words before "Accept?", no line over 30 words
|
|
24
|
+
* reuse reuse_check.mjs on what changed since the run's base (--base, else the `base <sha>` on the run file's
|
|
25
|
+
* code line): no copied function body and no method that only calls another (the reuse ladder); the
|
|
26
|
+
* other kinds (a shared locator, repeated steps, unused, same name) are listed, not failed
|
|
27
|
+
* Exit code: 0 all PASS or SKIP · 1 a FAIL (not done: act on its next action and run this again) · 2 wrong arguments.
|
|
28
|
+
*/
|
|
29
|
+
import fs from 'node:fs';
|
|
30
|
+
import path from 'node:path';
|
|
31
|
+
import { spawnSync } from 'node:child_process';
|
|
32
|
+
import { fileURLToPath, pathToFileURL } from 'node:url';
|
|
33
|
+
|
|
34
|
+
const HERE = path.dirname(fileURLToPath(import.meta.url));
|
|
35
|
+
|
|
36
|
+
function args(argv) {
|
|
37
|
+
const o = { results: 'project-context/results', known: [] };
|
|
38
|
+
for (let i = 0; i < argv.length; i++) {
|
|
39
|
+
const a = argv[i];
|
|
40
|
+
const v = () => argv[++i];
|
|
41
|
+
if (a === '--project') o.project = v();
|
|
42
|
+
else if (a === '--story') o.story = v();
|
|
43
|
+
else if (a === '--run') o.run = v();
|
|
44
|
+
else if (a === '--command') o.command = v();
|
|
45
|
+
else if (a === '--no-run') o.noRun = true;
|
|
46
|
+
else if (a === '--results') o.results = v();
|
|
47
|
+
else if (a === '--report') o.report = v();
|
|
48
|
+
else if (a === '--result-text') o.resultText = v();
|
|
49
|
+
else if (a === '--known-failures') o.known = v().split(',').map((s) => s.trim()).filter(Boolean);
|
|
50
|
+
else if (a === '--json') o.json = true;
|
|
51
|
+
else if (a === '--existing') o.existing = true;
|
|
52
|
+
else if (a === '--base') o.base = v();
|
|
53
|
+
else { console.log(`done_check: unknown argument ${a}`); process.exit(2); }
|
|
54
|
+
}
|
|
55
|
+
if (!o.project || !o.story || !o.run) {
|
|
56
|
+
console.log('usage: node .claude/skills/orion/scripts/done_check.mjs --project <test project> --story <KEY> --run <run id> [--command "npm test"] [--report <file>] [--result-text <file>] [--known-failures TS-4]');
|
|
57
|
+
process.exit(2);
|
|
58
|
+
}
|
|
59
|
+
return o;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
const node = (script, a, cwd) => spawnSync(process.execPath, [path.join(HERE, script), ...a], { cwd, encoding: 'utf8' });
|
|
63
|
+
|
|
64
|
+
/** The command a person would run in this project, when none was given. */
|
|
65
|
+
function defaultCommand(project) {
|
|
66
|
+
if (fs.existsSync(path.join(project, 'package.json'))) {
|
|
67
|
+
try { if (JSON.parse(fs.readFileSync(path.join(project, 'package.json'), 'utf8')).scripts?.test) return 'npm test'; } catch { /* reported by the project check */ }
|
|
68
|
+
}
|
|
69
|
+
if (['pytest.ini', 'conftest.py', 'pyproject.toml'].some((f) => fs.existsSync(path.join(project, f)))) return 'pytest';
|
|
70
|
+
if (fs.existsSync(path.join(project, 'pom.xml'))) return 'mvn -q test';
|
|
71
|
+
if (fs.readdirSync(project).some((f) => /\.(csproj|sln)$/.test(f))) return 'dotnet test';
|
|
72
|
+
return null;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/** Words in a line, a code span counting as one. */
|
|
76
|
+
const words = (s) => s.replace(/`[^`]*`/g, 'x').split(/\s+/).filter(Boolean).length;
|
|
77
|
+
|
|
78
|
+
export function checkResultText(text) {
|
|
79
|
+
const top = text.split(/Accept\?/)[0].trim();
|
|
80
|
+
const lines = top.split('\n').filter((l) => l.trim());
|
|
81
|
+
const problems = [];
|
|
82
|
+
if (!/Accept\?/.test(text)) problems.push('no "Accept? (yes / changes)"');
|
|
83
|
+
if (lines.some((l) => /^\s*\|/.test(l))) problems.push('a table (coverage is one line)');
|
|
84
|
+
const n = words(top);
|
|
85
|
+
if (n > 120) problems.push(`${n} words before "Accept?" (at most 120)`);
|
|
86
|
+
const long = lines.filter((l) => words(l) > 30);
|
|
87
|
+
if (long.length) problems.push(`${long.length} line(s) over 30 words, e.g. "${long[0].slice(0, 60)}…"`);
|
|
88
|
+
if (lines.length > 7) problems.push(`${lines.length} lines before "Accept?" (the 5 lines of conversation.md, at most 2 of them ⚠️)`);
|
|
89
|
+
return problems;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
function main() {
|
|
93
|
+
const o = args(process.argv.slice(2));
|
|
94
|
+
const root = process.cwd();
|
|
95
|
+
const project = path.resolve(root, o.project);
|
|
96
|
+
const rows = [];
|
|
97
|
+
const add = (check, status, detail, next = '') => rows.push({ check, status, detail, next });
|
|
98
|
+
|
|
99
|
+
// project
|
|
100
|
+
const sc = node('suite_check.mjs', [project], root);
|
|
101
|
+
const existing = o.existing || /suite Orion didn't generate/.test(sc.stdout || '');
|
|
102
|
+
let found = (sc.stdout || '').split('\n').filter((l) => l.includes(project) && !/: \w+ suite,/.test(l));
|
|
103
|
+
if (existing) found = found.filter((l) => /unfilled starter placeholder|package\.json: script/.test(l));
|
|
104
|
+
const m = /suite check: (\d+) finding/.exec(sc.stdout || '');
|
|
105
|
+
if (!m && !existing) add('project', 'FAIL', `suite_check exit ${sc.status}`, 'run suite_check on the project and fix what it names');
|
|
106
|
+
else if (!found.length) add('project', 'PASS', existing ? 'existing suite: no placeholders left, every script names a real project' : 'suite_check: 0 findings');
|
|
107
|
+
else add('project', 'FAIL', found.slice(0, 3).join(' | '), 'fix what suite_check names, then run it again');
|
|
108
|
+
|
|
109
|
+
// command
|
|
110
|
+
const command = o.command || defaultCommand(project);
|
|
111
|
+
if (o.noRun) add('command', 'SKIP', `not run (--no-run)${command ? `: ${command}` : ''}`);
|
|
112
|
+
else if (!command) add('command', 'FAIL', 'no command a person could run (no test script)', 'give the project a test command and name it in the result');
|
|
113
|
+
else {
|
|
114
|
+
const r = spawnSync(command, { cwd: project, shell: true, encoding: 'utf8', timeout: 20 * 60 * 1000, env: { ...process.env, CI: '1' } });
|
|
115
|
+
const out = `${r.stdout || ''}${r.stderr || ''}`;
|
|
116
|
+
const failing = [...new Set((out.match(/^.*(✘|\bfailed\b|FAILED|\[fail\]).*$/gim) || []).flatMap((l) => l.match(/\bTS-\d+\b/g) || []))];
|
|
117
|
+
const unknown = failing.filter((t) => !o.known.includes(t));
|
|
118
|
+
if (r.status === 0) add('command', 'PASS', `${command}: exit 0`);
|
|
119
|
+
else if (failing.length && !unknown.length) add('command', 'PASS', `${command}: exit ${r.status}, failing only known app defects ${failing.join(', ')}`);
|
|
120
|
+
else add('command', 'FAIL', `${command}: exit ${r.status}${unknown.length ? `, failing ${unknown.join(', ')}` : ''} · ${out.trim().split('\n').slice(-2).join(' | ').slice(0, 160)}`,
|
|
121
|
+
unknown.length ? 'classify the failures (recovery loop) and heal or report them' : 'make the command run as given (a missing project, a setup step, a download)');
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// runs
|
|
125
|
+
const dir = path.resolve(root, o.results);
|
|
126
|
+
const files = fs.existsSync(dir) ? fs.readdirSync(dir).filter((f) => f.startsWith(o.run) && f.endsWith('.json') && !/\.(pw|raw|report)\.json$/.test(f)).sort() : [];
|
|
127
|
+
if (files.length < 3) add('runs', 'FAIL', `${files.length} results file(s) for ${o.run} in ${o.results}`, 'after each counted run: results_parse.mjs <report> --run <run id>-<n> --out project-context/results/<run id>-<n>.json');
|
|
128
|
+
else {
|
|
129
|
+
const bad = [];
|
|
130
|
+
for (const f of files) {
|
|
131
|
+
let d;
|
|
132
|
+
try { d = JSON.parse(fs.readFileSync(path.join(dir, f), 'utf8')); } catch { bad.push(`${f}: not JSON`); continue; }
|
|
133
|
+
const tests = (d.tests || []).filter((t) => t.test_id && (!t.story || t.story === o.story || String(t.test_id).startsWith(`${o.story}:`)));
|
|
134
|
+
if (!tests.length) bad.push(`${f}: no ${o.story} tests`);
|
|
135
|
+
for (const t of tests) {
|
|
136
|
+
const id = String(t.test_id).replace(/^.*:/, '');
|
|
137
|
+
if (o.known.includes(id)) continue;
|
|
138
|
+
if (t.status !== 'passed' || (t.attempts || 1) > 1) bad.push(`${f}: ${id} ${t.status}${t.attempts > 1 ? ` after ${t.attempts} attempts` : ''}`);
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
if (bad.length) add('runs', 'FAIL', bad.slice(0, 4).join(' | '), 'a new test passes 3 of 3 with retries off: recovery loop for each test named');
|
|
142
|
+
else add('runs', 'PASS', `${files.length} recorded runs, every ${o.story} test passed first time`);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
// coverage
|
|
146
|
+
const gc = node('graph.mjs', ['check', '--story', o.story], root);
|
|
147
|
+
const g = /graph check [^:]*: (\d+) gap/.exec(gc.stdout || '');
|
|
148
|
+
if (!g && /no graph|not built|ENOENT/i.test(`${gc.stdout}${gc.stderr}`)) add('coverage', 'FAIL', 'no graph', 'graph.mjs build, then run this again');
|
|
149
|
+
else if (g && g[1] !== '0') add('coverage', 'FAIL', (gc.stdout || '').split('\n').filter((l) => l.startsWith(`${o.story}:`)).slice(0, 3).join(' | '), 'write the missing test or case, or name the gap in the result as an open item (--known-failures does not cover gaps)');
|
|
150
|
+
else if (g) add('coverage', 'PASS', 'graph check: 0 gaps');
|
|
151
|
+
else add('coverage', 'SKIP', `graph check gave no count (exit ${gc.status})`);
|
|
152
|
+
|
|
153
|
+
// reuse ladder: new code must not copy or wrap what already exists
|
|
154
|
+
let base = o.base;
|
|
155
|
+
if (!base) {
|
|
156
|
+
const rf = path.join(root, 'project-context', 'runs', `${o.run}.md`);
|
|
157
|
+
if (fs.existsSync(rf)) base = (fs.readFileSync(rf, 'utf8').match(/^code: .*\bbase ([0-9a-f]{7,40})\b/m) || [])[1];
|
|
158
|
+
}
|
|
159
|
+
if (!base) add('reuse', 'SKIP', 'no git base for this run (--base or the run file\'s code line)');
|
|
160
|
+
else {
|
|
161
|
+
const rc = node('reuse_check.mjs', [project, '--changed', base, '--json'], root);
|
|
162
|
+
let found = null;
|
|
163
|
+
try { found = JSON.parse(rc.stdout).findings || []; } catch { found = null; }
|
|
164
|
+
if (!found) add('reuse', 'SKIP', `reuse_check gave no result (exit ${rc.status})`);
|
|
165
|
+
else {
|
|
166
|
+
const hard = found.filter((f) => ['duplicate', 'pass-through'].includes(f.kind));
|
|
167
|
+
const soft = found.length - hard.length;
|
|
168
|
+
if (hard.length) add('reuse', 'FAIL', hard.slice(0, 3).map((f) => `${f.file}:${f.line} ${f.kind}: ${f.what}`.slice(0, 150)).join(' | '), 'reuse or extend the existing code (the reuse ladder in automation-implementation), then run this again');
|
|
169
|
+
else add('reuse', 'PASS', `no copied or pass-through code in the change${soft ? ` (${soft} note(s) for the report: shared locators, repeated steps)` : ''}`);
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
// report and result
|
|
174
|
+
if (o.report) {
|
|
175
|
+
const rc = node('report_check.mjs', [o.report], root);
|
|
176
|
+
const n = /report check: (\d+) finding/.exec(rc.stdout || '');
|
|
177
|
+
if (n && n[1] === '0') add('report', 'PASS', 'report_check: 0 findings');
|
|
178
|
+
else add('report', 'FAIL', (rc.stdout || '').split('\n')[0].slice(0, 160), 'fix the report as report_check says');
|
|
179
|
+
} else add('report', 'SKIP', 'no --report');
|
|
180
|
+
if (o.resultText) {
|
|
181
|
+
const p = checkResultText(fs.readFileSync(path.resolve(root, o.resultText), 'utf8'));
|
|
182
|
+
if (p.length) add('result', 'FAIL', p.join('; '), 'rewrite the result as conversation.md\'s 5 lines');
|
|
183
|
+
else add('result', 'PASS', 'short: 5 lines, within 120 words');
|
|
184
|
+
} else add('result', 'SKIP', 'no --result-text');
|
|
185
|
+
|
|
186
|
+
const failed = rows.filter((r) => r.status === 'FAIL');
|
|
187
|
+
if (o.json) console.log(JSON.stringify({ story: o.story, run: o.run, done: !failed.length, rows }, null, 1));
|
|
188
|
+
else {
|
|
189
|
+
for (const r of rows) console.log(`${r.status.padEnd(4)} ${r.check.padEnd(8)} ${r.detail}${r.next ? `\n next: ${r.next}` : ''}`);
|
|
190
|
+
console.log(failed.length ? `not done: ${failed.length} check(s) failed (${failed.map((r) => r.check).join(', ')}); act on the first, then run done_check again` : 'done: every check passed');
|
|
191
|
+
}
|
|
192
|
+
process.exit(failed.length ? 1 : 0);
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
if (import.meta.url === pathToFileURL(process.argv[1]).href) main();
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
/**
|
|
3
3
|
* Says which test-account settings a test project's .env holds, without ever printing a value.
|
|
4
4
|
*
|
|
5
|
-
* Usage (from the workspace root; the argument is the test project's
|
|
5
|
+
* Usage (from the workspace root; the argument is the test project's folder, or an existing suite's own env file, e.g. env-files/.env.dev):
|
|
6
6
|
* node .claude/skills/orion/scripts/env_check.mjs sut/<site>
|
|
7
7
|
*
|
|
8
8
|
* Prints one line per name: set (has a value) · empty (name with no value) · missing (no such line).
|
|
@@ -59,10 +59,15 @@ function main(argv) {
|
|
|
59
59
|
return 2;
|
|
60
60
|
}
|
|
61
61
|
let folder = argv[0];
|
|
62
|
+
let name = '.env';
|
|
62
63
|
const trimmed = folder.replace(/[/\\]+$/, '');
|
|
63
|
-
|
|
64
|
+
// A file: the project's .env, or an existing suite's own env file (env-files/.env.dev).
|
|
65
|
+
if (path.basename(trimmed) === '.env' || isFile(trimmed)) { folder = path.dirname(trimmed) || '.'; name = path.basename(trimmed); }
|
|
64
66
|
if (!isDir(folder)) { console.log(`${folder}: no such folder`); return 2; }
|
|
65
|
-
|
|
67
|
+
// Runs without a permission prompt: only files inside the workspace (symlinks resolved).
|
|
68
|
+
const root = fs.realpathSync(process.cwd()); const real = fs.realpathSync(folder);
|
|
69
|
+
if (real !== root && !real.startsWith(root + path.sep)) { console.log(`refused: ${folder} is outside the workspace`); return 2; }
|
|
70
|
+
const env = pyJoin(folder, name);
|
|
66
71
|
const example = pyJoin(folder, '.env.example');
|
|
67
72
|
const order = [...STANDARD];
|
|
68
73
|
if (isFile(example)) for (const name of parse(example)[0].keys()) if (!order.includes(name)) order.push(name);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"""Say which test-account settings a test project's .env holds, without ever printing a value.
|
|
2
2
|
|
|
3
|
-
Usage (from the workspace root; the argument is the test project's
|
|
3
|
+
Usage (from the workspace root; the argument is the test project's folder, or an existing suite's own env file, e.g. env-files/.env.dev):
|
|
4
4
|
python3 .claude/skills/orion/scripts/env_check.py sut/<site> (Windows: py ... sut\\<site>)
|
|
5
5
|
|
|
6
6
|
Prints one line per name: set (has a value) · empty (name with no value) · missing (no such line).
|
|
@@ -52,13 +52,20 @@ def main(argv):
|
|
|
52
52
|
if len(argv) != 2 or argv[1] in ("-h", "--help"):
|
|
53
53
|
print(__doc__.strip())
|
|
54
54
|
return 2
|
|
55
|
-
folder = argv[1]
|
|
56
|
-
|
|
57
|
-
|
|
55
|
+
folder, name = argv[1], ".env"
|
|
56
|
+
trimmed = folder.rstrip("/\\")
|
|
57
|
+
# A file: the project's .env, or an existing suite's own env file (env-files/.env.dev).
|
|
58
|
+
if os.path.basename(trimmed) == ".env" or os.path.isfile(trimmed):
|
|
59
|
+
folder, name = os.path.dirname(trimmed) or ".", os.path.basename(trimmed)
|
|
58
60
|
if not os.path.isdir(folder):
|
|
59
61
|
print(f"{folder}: no such folder")
|
|
60
62
|
return 2
|
|
61
|
-
|
|
63
|
+
# Runs without a permission prompt: only files inside the workspace (symlinks resolved).
|
|
64
|
+
root, real = os.path.realpath(os.getcwd()), os.path.realpath(folder)
|
|
65
|
+
if real != root and not real.startswith(root + os.sep):
|
|
66
|
+
print(f"refused: {folder} is outside the workspace")
|
|
67
|
+
return 2
|
|
68
|
+
env = os.path.join(folder, name)
|
|
62
69
|
example = os.path.join(folder, ".env.example")
|
|
63
70
|
order = list(STANDARD)
|
|
64
71
|
if os.path.isfile(example):
|
|
@@ -0,0 +1,170 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* The fix plan for `/orion fix A-<id>`: turns an assessment's findings into batches the user ticks, and keeps each
|
|
4
|
+
* batch's state so a fix run that stops (usage limit, "stop", a crash) resumes at the first unfinished batch.
|
|
5
|
+
*
|
|
6
|
+
* Usage (from the workspace root):
|
|
7
|
+
* node .claude/skills/orion/scripts/fix_plan.mjs make <assessment.md> [--out <fix-plan.md>]
|
|
8
|
+
* batches of ≤ 5 findings touching ≤ 8 files, findings of one file kept together, most severe first;
|
|
9
|
+
* every item starts unticked. Default out: fix-plan.md next to the assessment.
|
|
10
|
+
* node .claude/skills/orion/scripts/fix_plan.mjs tick <fix-plan.md> F-1 F-3 … tick the items the user chose
|
|
11
|
+
* node .claude/skills/orion/scripts/fix_plan.mjs untick <fix-plan.md> F-2 …
|
|
12
|
+
* node .claude/skills/orion/scripts/fix_plan.mjs next <fix-plan.md> the first batch with ticked items that isn't
|
|
13
|
+
* verified, reverted or skipped, as JSON (exit 1 when none is left)
|
|
14
|
+
* node .claude/skills/orion/scripts/fix_plan.mjs set <fix-plan.md> <batch n> <state> ["<note>"]
|
|
15
|
+
* state: pending · applied · verified · reverted · skipped
|
|
16
|
+
* node .claude/skills/orion/scripts/fix_plan.mjs summary <fix-plan.md>
|
|
17
|
+
* node .claude/skills/orion/scripts/fix_plan.mjs scope <fix-plan.md> <batch n> --since <batch start sha> [--until <sha>] [--repo <work copy>]
|
|
18
|
+
* the files the batch changed (git diff from its start, plus new files) against its ticked items' `changes:`
|
|
19
|
+
* lists: exit 1 naming each file outside them. Run before the review; a file outside stops the batch, and the
|
|
20
|
+
* user is asked (H14) to add it to the item, never edited silently.
|
|
21
|
+
* Each item says whether it needs the user's H8 (it changes what a test asserts or expects: U6, U8, U12, P15, or a
|
|
22
|
+
* proposed fix that names an assertion or expected value) and whether it needs a secret's variable name (U2).
|
|
23
|
+
* Each item lists the files its fix may change (`changes:`): the assessment's "Changes" column when it has one (e.g. a
|
|
24
|
+
* page object and the test an assertion moves into), else the files in its File:line cell. A batch's files are the
|
|
25
|
+
* union of its items' files; the implementer changes nothing else.
|
|
26
|
+
* Unticked items are never part of a batch the implementer gets. Exit code: 0 · 1 nothing found · 2 wrong arguments.
|
|
27
|
+
*/
|
|
28
|
+
import fs from 'node:fs';
|
|
29
|
+
import path from 'node:path';
|
|
30
|
+
import { execFileSync } from 'node:child_process';
|
|
31
|
+
import { insideWorkspace } from './lib/inside.mjs';
|
|
32
|
+
|
|
33
|
+
const SEV = { critical: 0, blocking: 1, major: 2, minor: 3 };
|
|
34
|
+
const STATES = ['pending', 'applied', 'verified', 'reverted', 'skipped'];
|
|
35
|
+
const H8_RULES = new Set(['U6', 'U8', 'U12', 'P15']);
|
|
36
|
+
const MAX_FINDINGS = 5; const MAX_FILES = 8;
|
|
37
|
+
|
|
38
|
+
function die(code, msg) { console.log(msg); process.exit(code); }
|
|
39
|
+
const read = (f) => { try { return fs.readFileSync(f, 'utf8'); } catch { die(2, `can't read ${f}`); } return ''; };
|
|
40
|
+
|
|
41
|
+
/** File paths in a table cell ("a.ts:4,17 · b.ts:2", ".gitignore:1"), in order, without lines. */
|
|
42
|
+
const pathsIn = (cell) => [...new Set([...(cell || '').replace(/`/g, '').matchAll(/(?:^|[\s,(·;])((?:[\w@.-]+\/)*(?:[\w@-][\w@.-]*\.[A-Za-z]\w*|\.[\w-]+))(?=$|[\s:,)·;])/g)].map((m) => m[1]))];
|
|
43
|
+
|
|
44
|
+
/** Findings rows of an assessment: [{id, rule, severity, file, line, quote, by, effort, fix, risk}] */
|
|
45
|
+
function findings(text) {
|
|
46
|
+
const lines = text.split('\n');
|
|
47
|
+
const h = lines.findIndex((l) => /^\|\s*F\s*\|\s*Rule\s*\|/i.test(l));
|
|
48
|
+
if (h < 0) die(1, 'no findings table (| F | Rule | … |) in the assessment');
|
|
49
|
+
const cols = lines[h].split('|').slice(1, -1).map((c) => c.trim().toLowerCase());
|
|
50
|
+
const at = (name) => cols.findIndex((c) => c.startsWith(name));
|
|
51
|
+
const out = [];
|
|
52
|
+
for (let i = h + 2; i < lines.length && lines[i].startsWith('|'); i++) {
|
|
53
|
+
const c = lines[i].split('|').slice(1, -1).map((x) => x.trim());
|
|
54
|
+
if (!/^F-\d+$/.test(c[0])) continue;
|
|
55
|
+
const loc = (c[at('file')] || '').replace(/`/g, '').trim();
|
|
56
|
+
const inLoc = pathsIn(loc);
|
|
57
|
+
const file = inLoc[0] || loc;
|
|
58
|
+
const m = loc.slice(loc.indexOf(file) + file.length).match(/^:(\d+)/);
|
|
59
|
+
const ch = at('changes') >= 0 ? pathsIn(c[at('changes')]) : [];
|
|
60
|
+
out.push({ id: c[0], rule: c[at('rule')], severity: (c[at('severity')] || 'minor').toLowerCase(), file, line: m ? Number(m[1]) : null,
|
|
61
|
+
files: ch.length ? ch : (inLoc.length ? inLoc : [file]),
|
|
62
|
+
quote: c[at('quote')] || '', by: c[at('detected')] || '', effort: c[at('effort')] || '', fix: c[at('proposed')] || '', risk: c[at('parity')] || '' });
|
|
63
|
+
}
|
|
64
|
+
return out;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
function needs(f) {
|
|
68
|
+
const n = [];
|
|
69
|
+
// Moving an assertion keeps what it checks (parity_check proves that); changing an expected value, a matcher or the
|
|
70
|
+
// assertion's strength changes what the test checks, which needs the user's H8.
|
|
71
|
+
if (H8_RULES.has(f.rule) || /\b(expected (value|text|status|count)|change (the |an )?(assertion|expected)|(weaker|stronger) assert\w*|matcher)\b/i.test(f.fix)) n.push('H8');
|
|
72
|
+
if (f.rule === 'U2') n.push('secret: the variable name in .env / CI');
|
|
73
|
+
return n;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
function make(file, out) {
|
|
77
|
+
const fs_ = findings(read(file)).sort((a, b) => (SEV[a.severity] ?? 9) - (SEV[b.severity] ?? 9) || a.file.localeCompare(b.file) || (a.line || 0) - (b.line || 0));
|
|
78
|
+
if (!fs_.length) die(1, 'the assessment has no findings to fix');
|
|
79
|
+
// group by file, then pack files into batches
|
|
80
|
+
const byFile = new Map();
|
|
81
|
+
for (const f of fs_) { if (!byFile.has(f.file)) byFile.set(f.file, []); byFile.get(f.file).push(f); }
|
|
82
|
+
const batches = []; let cur = { items: [], files: new Set() };
|
|
83
|
+
for (const [file, items] of byFile) {
|
|
84
|
+
for (let k = 0; k < items.length; k += MAX_FINDINGS) {
|
|
85
|
+
const chunk = items.slice(k, k + MAX_FINDINGS);
|
|
86
|
+
if (cur.items.length + chunk.length > MAX_FINDINGS || (!cur.files.has(file) && cur.files.size >= MAX_FILES)) { batches.push(cur); cur = { items: [], files: new Set() }; }
|
|
87
|
+
const add = new Set(chunk.flatMap((f) => f.files));
|
|
88
|
+
if (cur.items.length && [...add].filter((x) => !cur.files.has(x)).length + cur.files.size > MAX_FILES) { batches.push(cur); cur = { items: [], files: new Set() }; }
|
|
89
|
+
cur.items.push(...chunk); for (const x of add) cur.files.add(x);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
if (cur.items.length) batches.push(cur);
|
|
93
|
+
const id = path.basename(path.dirname(file));
|
|
94
|
+
const lines = [`# Fix plan ${id}`, '',
|
|
95
|
+
`From \`${path.basename(file)}\`. Tick the items to fix (reply with their ids, or put an x in the box); nothing unticked is touched. Each batch is applied on the local branch \`orion/fix-${id}\`, reviewed, run, and kept only if \`parity_check.mjs\` holds; otherwise it is reverted. Items marked H8 change what a test checks and need your explicit yes.`, ''];
|
|
96
|
+
batches.forEach((b, n) => {
|
|
97
|
+
lines.push(`## Batch ${n + 1} · state: pending`, `files: ${[...b.files].join(', ')}`, '');
|
|
98
|
+
for (const f of b.items) lines.push(`- [ ] ${f.id} · ${f.rule} ${f.severity} · ${f.file}${f.line ? `:${f.line}` : ''} · ${f.fix || '(fix to be proposed)'} · changes: ${f.files.join(', ')}${needs(f).length ? ` · needs ${needs(f).join(', ')}` : ''}`);
|
|
99
|
+
lines.push('');
|
|
100
|
+
});
|
|
101
|
+
const dest = insideWorkspace(out || path.join(path.dirname(file), 'fix-plan.md'), 'the fix plan');
|
|
102
|
+
fs.writeFileSync(dest, `${lines.join('\n')}\n`);
|
|
103
|
+
console.log(`fix plan: ${fs_.length} finding(s) in ${batches.length} batch(es) → ${dest}`);
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
function parse(text) {
|
|
107
|
+
const lines = text.split('\n'); const batches = [];
|
|
108
|
+
lines.forEach((l, i) => {
|
|
109
|
+
const b = l.match(/^## Batch (\d+) · state: (\w+)(.*)$/);
|
|
110
|
+
if (b) batches.push({ n: Number(b[1]), state: b[2], note: b[3].replace(/^\s*·\s*/, ''), line: i, items: [] });
|
|
111
|
+
const it = l.match(/^- \[( |x|X)\] (F-\d+) · (.*)$/);
|
|
112
|
+
if (it && batches.length) batches[batches.length - 1].items.push({ id: it[2], ticked: it[1] !== ' ', text: it[3], line: i });
|
|
113
|
+
});
|
|
114
|
+
return { lines, batches };
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
function main() {
|
|
118
|
+
const [cmd, file, ...rest] = process.argv.slice(2);
|
|
119
|
+
if (!cmd || !file) die(2, 'usage: fix_plan.mjs make|tick|untick|next|set|summary <file> …');
|
|
120
|
+
if (cmd === 'make') return make(file, rest[0] === '--out' ? insideWorkspace(rest[1], '--out') : null);
|
|
121
|
+
if (['tick', 'untick', 'set'].includes(cmd)) insideWorkspace(file, 'the fix plan');
|
|
122
|
+
const { lines, batches } = parse(read(file));
|
|
123
|
+
if (!batches.length) die(1, 'no batches in the fix plan');
|
|
124
|
+
if (cmd === 'tick' || cmd === 'untick') {
|
|
125
|
+
if (!rest.length) die(2, `${cmd} needs finding ids`);
|
|
126
|
+
const known = new Set(batches.flatMap((b) => b.items.map((i) => i.id)));
|
|
127
|
+
const unknown = rest.filter((id) => !known.has(id));
|
|
128
|
+
if (unknown.length) die(1, `not in the plan: ${unknown.join(', ')}`);
|
|
129
|
+
for (const b of batches) for (const it of b.items) if (rest.includes(it.id)) lines[it.line] = lines[it.line].replace(/^- \[[ xX]\]/, cmd === 'tick' ? '- [x]' : '- [ ]');
|
|
130
|
+
fs.writeFileSync(file, lines.join('\n'));
|
|
131
|
+
return console.log(`${cmd}ed ${rest.join(', ')}`);
|
|
132
|
+
}
|
|
133
|
+
if (cmd === 'set') {
|
|
134
|
+
const [n, state, ...note] = rest;
|
|
135
|
+
const b = batches.find((x) => x.n === Number(n));
|
|
136
|
+
if (!b || !STATES.includes(state)) die(2, `set <batch n> <${STATES.join('|')}> ["note"]`);
|
|
137
|
+
lines[b.line] = `## Batch ${b.n} · state: ${state}${note.length ? ` · ${note.join(' ').replace(/\n/g, ' ')}` : ''}`;
|
|
138
|
+
fs.writeFileSync(file, lines.join('\n'));
|
|
139
|
+
return console.log(`batch ${b.n}: ${state}`);
|
|
140
|
+
}
|
|
141
|
+
if (cmd === 'next') {
|
|
142
|
+
const b = batches.find((x) => x.items.some((i) => i.ticked) && !['verified', 'reverted', 'skipped'].includes(x.state));
|
|
143
|
+
if (!b) die(1, 'no batch left: every ticked item is verified, reverted or skipped');
|
|
144
|
+
return console.log(JSON.stringify({ batch: b.n, state: b.state, items: b.items.filter((i) => i.ticked).map((i) => ({ id: i.id, text: i.text })) }, null, 2));
|
|
145
|
+
}
|
|
146
|
+
if (cmd === 'scope') {
|
|
147
|
+
const [n, ...opts] = rest;
|
|
148
|
+
const opt = (k) => { const i = opts.indexOf(k); return i >= 0 ? opts[i + 1] : undefined; };
|
|
149
|
+
const since = opt('--since');
|
|
150
|
+
const repo = opt('--repo') || '.';
|
|
151
|
+
const until = opt('--until');
|
|
152
|
+
const b = batches.find((x) => x.n === Number(n));
|
|
153
|
+
if (!b || !since || ![since, until || since].every((s) => /^[0-9a-f]{7,40}$/i.test(s))) die(2, 'scope <batch n> --since <commit sha> [--until <commit sha>] [--repo <work copy>]');
|
|
154
|
+
const git = (...a) => { try { return execFileSync('git', ['-C', repo, ...a], { encoding: 'utf8' }); } catch (e) { die(2, `git failed in ${repo}: ${e.message.split('\n')[0]}`); } return ''; };
|
|
155
|
+
const changed = [...new Set([...git('diff', '--name-only', since, ...(until ? [until] : []), '--').split('\n'), ...(until ? [] : git('ls-files', '--others', '--exclude-standard').split('\n'))]
|
|
156
|
+
.map((f) => f.trim()).filter((f) => f && !f.startsWith('project-context/') && !f.startsWith('.ui-map/')))];
|
|
157
|
+
const allowed = new Set(b.items.filter((i) => i.ticked).flatMap((i) => (i.text.match(/·\s*changes:\s*([^·]+)/)?.[1] || '').split(',').map((s) => s.trim()).filter(Boolean)));
|
|
158
|
+
const outside = changed.filter((f) => !allowed.has(f));
|
|
159
|
+
if (outside.length) die(1, `batch ${b.n} changed files outside its items' changes lists: ${outside.join(', ')} (allowed: ${[...allowed].join(', ') || 'none'})`);
|
|
160
|
+
return console.log(`batch ${b.n}: ${changed.length} changed file(s), all in its items' changes lists`);
|
|
161
|
+
}
|
|
162
|
+
if (cmd === 'summary') {
|
|
163
|
+
const t = batches.flatMap((b) => b.items).filter((i) => i.ticked).length;
|
|
164
|
+
for (const b of batches) console.log(`batch ${b.n}: ${b.state} · ticked ${b.items.filter((i) => i.ticked).length}/${b.items.length}${b.note ? ` · ${b.note}` : ''}`);
|
|
165
|
+
return console.log(`ticked ${t} of ${batches.flatMap((b) => b.items).length}`);
|
|
166
|
+
}
|
|
167
|
+
die(2, `unknown command ${cmd}`);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
main();
|