@buaa_smat/hometrans 26.0.5 → 26.0.6
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/README.md +249 -279
- package/agents/code-reviewer.md +1 -1
- package/dist/cli/editors.json +20 -0
- package/dist/platform/registry.js +1 -0
- package/dist/platform/validate.js +2 -1
- package/i18n/agents/code-reviewer.md +1 -1
- package/i18n/platforms/atomcode/skills/a2h-app-migrate/SKILL.unique.md +3 -0
- package/i18n/platforms/claude-code/skills/a2h-app-migrate/SKILL.unique.md +3 -0
- package/i18n/platforms/codebuddy/skills/a2h-app-migrate/SKILL.unique.md +8 -0
- package/i18n/platforms/codex/skills/a2h-app-migrate/SKILL.unique.md +3 -0
- package/i18n/platforms/cursor/skills/a2h-app-migrate/SKILL.unique.md +3 -0
- package/i18n/platforms/deveco/skills/a2h-app-migrate/SKILL.unique.md +3 -0
- package/i18n/platforms/opencode/skills/a2h-app-migrate/SKILL.unique.md +10 -0
- package/i18n/platforms/qoder/skills/a2h-app-migrate/SKILL.unique.md +3 -0
- package/i18n/platforms/qoder-cn/skills/a2h-app-migrate/SKILL.unique.md +8 -0
- package/i18n/platforms/trae/skills/a2h-app-migrate/SKILL.unique.md +3 -0
- package/i18n/platforms/trae-cn/skills/a2h-app-migrate/SKILL.unique.md +3 -0
- package/i18n/skills/a2h-app-migrate/SKILL.md +32 -15
- package/i18n/skills/a2h-app-migrate/references/stage-map.md +4 -2
- package/i18n/skills/a2h-app-migrate/references/workflow.yaml +148 -89
- package/i18n/skills/a2h-app-migrate/scripts/env_preflight.mjs +1 -1
- package/i18n/skills/a2h-app-migrate/scripts/validate_workflow.mjs +51 -2
- package/i18n/skills/a2h-app-migrate/test/test_build_fixer_contract.mjs +1 -1
- package/i18n/skills/a2h-app-migrate/test/test_interaction.mjs +0 -2
- package/i18n/skills/a2h-app-migrate/test/test_resume_plan.mjs +1 -1
- package/i18n/skills/a2h-app-migrate/test/test_skill_doc.mjs +1 -1
- package/i18n/skills/a2h-app-migrate/test/test_specs_json_preflight.mjs +1 -1
- package/i18n/skills/a2h-app-migrate/test/test_utg_static_done.mjs +9 -3
- package/i18n/skills/a2h-app-migrate/test/test_validate_workflow_bilingual.mjs +4 -2
- package/i18n/skills/a2h-arkts-logic-coder/SKILL.md +8 -7
- package/i18n/skills/a2h-arkts-logic-coder/references/ISSUES.md +2 -2
- package/i18n/skills/a2h-arkts-logic-coder/references/code-generation.md +33 -12
- package/i18n/skills/a2h-batch-ui-align/SKILL.md +14 -12
- package/i18n/skills/a2h-batch-ui-align/references/cards/alignment.md +1 -0
- package/i18n/skills/a2h-batch-ui-align/references/cards/canvas.md +1 -0
- package/i18n/skills/a2h-batch-ui-align/references/cards/dynamics.md +32 -1
- package/i18n/skills/a2h-batch-ui-align/references/cards/geometry.md +3 -2
- package/i18n/skills/a2h-batch-ui-align/references/cards/interaction.md +4 -0
- package/i18n/skills/a2h-batch-ui-align/references/cards/resources.md +19 -1
- package/i18n/skills/a2h-batch-ui-align/references/cards/widgets.md +13 -1
- package/i18n/skills/a2h-batch-ui-align/references/cards/window.md +2 -2
- package/i18n/skills/a2h-batch-ui-align/references/checker-rules.md +205 -7
- package/i18n/skills/a2h-batch-ui-align/references/conversion-procedure.md +10 -17
- package/i18n/skills/a2h-batch-ui-align/references/incremental-scope.md +3 -4
- package/i18n/skills/a2h-batch-ui-align/references/lottie-integration.md +47 -2
- package/i18n/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-atomic-component-mapping-reference.md +52 -328
- package/i18n/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-interaction-mapping-reference.md +1 -138
- package/i18n/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-layout-mapping-reference.md +2 -11
- package/i18n/skills/a2h-batch-ui-align/references/state-mgmt/_paradigm-selection.md +1 -1
- package/i18n/skills/a2h-batch-ui-align/references/step3-capture.md +8 -23
- package/i18n/skills/a2h-batch-ui-align/references/step4-prepare.md +2 -1
- package/i18n/skills/a2h-batch-ui-align/references/step5-convert.md +17 -9
- package/i18n/skills/a2h-batch-ui-align/scripts/build_conversion_set.mjs +239 -16
- package/i18n/skills/a2h-batch-ui-align/scripts/group_pack.mjs +6 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/icon_coverage.mjs +6 -3
- package/i18n/skills/a2h-batch-ui-align/scripts/measure_pack.ts +170 -10
- package/i18n/skills/a2h-batch-ui-align/scripts/phase5_check.mjs +42 -1
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/main.ts +20 -1
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/attr_chain.ts +81 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/click_handler.ts +140 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/collapsing_toolbar.ts +124 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/compose_semantics.ts +287 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/flowitem_width.ts +78 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/hit_test.ts +194 -8
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/inset_stacked.ts +138 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/int_division.ts +181 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/layout_placement.ts +62 -2
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/lottie_path.ts +77 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/lottie_ready.ts +109 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/media_tint.ts +88 -18
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/relative_container_cycle.ts +140 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/relative_container_height.ts +2 -2
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/see_through_overlay.ts +149 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/sheet_builder.ts +139 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/sheet_show_close.ts +53 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/space_between_optional.ts +115 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/theme_color.ts +7 -1
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/width_fill.ts +160 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_inset_stacked.test.mjs +155 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_layout_placement.test.mjs +60 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/build_conversion_set.test.mjs +38 -0
- package/i18n/skills/a2h-module-semantic-docs/SKILL.md +3 -2
- package/i18n/skills/a2h-page-specgen/SKILL.md +36 -5
- package/i18n/skills/a2h-page-specgen/references/behavior-ledger.md +89 -21
- package/i18n/skills/a2h-page-specgen/references/gates.md +33 -7
- package/i18n/skills/a2h-page-specgen/references/scenario-authoring.md +67 -13
- package/i18n/skills/a2h-page-specgen/references/spec-example.md +166 -32
- package/i18n/skills/a2h-page-specgen/references/spec-template.md +8 -5
- package/i18n/skills/a2h-page-specgen/scripts/behavior-audit.mjs +37 -1
- package/i18n/skills/a2h-page-specgen/scripts/behavior-discovery.mjs +241 -22
- package/i18n/skills/a2h-page-specgen/scripts/behavior-model.mjs +29 -2
- package/i18n/skills/a2h-page-specgen/scripts/behavior-reconcile.mjs +32 -0
- package/i18n/skills/a2h-page-specgen/scripts/contract-calls.mjs +715 -0
- package/i18n/skills/a2h-page-specgen/scripts/footprint.mjs +129 -2
- package/i18n/skills/a2h-page-specgen/scripts/gate.mjs +19 -10
- package/i18n/skills/a2h-page-specgen/scripts/lib/contracts.mjs +62 -3
- package/i18n/skills/a2h-page-specgen/scripts/lib/graph-evidence.mjs +27 -0
- package/i18n/skills/a2h-page-specgen/scripts/lib/hg.mjs +116 -6
- package/i18n/skills/a2h-page-specgen/scripts/operation-evidence.mjs +270 -29
- package/i18n/skills/a2h-page-specgen/scripts/prepare.mjs +26 -14
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.prompt.md +118 -25
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.worker.md +104 -19
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.prompt.md +118 -25
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.worker.md +104 -19
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.discovery.json +216 -216
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.json +1 -1
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.post-review.json +2 -2
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.prompt.md +118 -25
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.worker.md +100 -15
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.prompt.md +118 -25
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.worker.md +104 -19
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/run.mjs +155 -3
- package/i18n/skills/a2h-page-specgen/scripts/test/android-operation-evidence.test.mjs +529 -1
- package/i18n/skills/a2h-page-specgen/scripts/test/behavior-audit-pre.test.mjs +27 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/behavior-discovery.test.mjs +158 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/behavior-fixtures.mjs +11 -13
- package/i18n/skills/a2h-page-specgen/scripts/test/behavior-reconcile.test.mjs +97 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/contract-calls.test.mjs +737 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/contracts.test.mjs +75 -3
- package/i18n/skills/a2h-page-specgen/scripts/test/finalize.test.mjs +24 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/hg.mkdb.mjs +124 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/footprint-resolve.test.mjs +6 -2
- package/i18n/skills/a2h-page-specgen/scripts/test/gate.test.mjs +106 -1
- package/i18n/skills/a2h-page-specgen/scripts/test/graph-evidence.test.mjs +32 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/hg.test.mjs +12 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/operation-reviews.test.mjs +6 -1
- package/i18n/skills/a2h-page-specgen/scripts/test/prompt-tpl.test.mjs +11 -3
- package/i18n/skills/a2h-page-specgen/scripts/test/protocol-docs.test.mjs +1 -1
- package/i18n/skills/a2h-page-specgen/scripts/test/recovery-e2e.test.mjs +1 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/submit.test.mjs +159 -27
- package/i18n/skills/a2h-resource-convert/SKILL.md +1 -1
- package/i18n/skills/a2h-resource-convert/references/lottie-conversion-rules.md +2 -2
- package/i18n/skills/a2h-resource-convert/scripts/a2h_resource_convert.ts +124 -8
- package/i18n/skills/a2h-resource-convert/scripts/sync-framework-strings.mjs +147 -0
- package/i18n/skills/a2h-resource-convert/scripts/tests/framework_strings.test.mjs +131 -0
- package/i18n/skills/a2h-spec-design-pipeline/SKILL.md +15 -12
- package/i18n/skills/a2h-spec-design-pipeline/references/coding-loop.md +38 -10
- package/i18n/skills/a2h-spec-design-pipeline/references/initialization.md +2 -2
- package/i18n/skills/a2h-spec-design-pipeline/references/post-loop.md +2 -2
- package/i18n/skills/a2h-spec-design-pipeline/references/reply-recovery.md +172 -0
- package/i18n/skills/a2h-spec-design-pipeline/references/review-loop.md +2 -2
- package/i18n/skills/a2h-spec-design-pipeline/references/scripts.md +5 -3
- package/i18n/skills/a2h-spec-design-pipeline/references/state-and-resume.md +7 -1
- package/i18n/skills/a2h-spec-design-pipeline/scripts/plan_groups.ts +1 -1
- package/i18n/skills/a2h-spec-design-pipeline/scripts/test_plan_groups.ts +2 -0
- package/i18n/skills/a2h-spec-generate/references/input-formats.md +1 -1
- package/i18n/skills/a2h-utg-explorer/SKILL.md +11 -5
- package/i18n/skills/a2h-utg-explorer/references/architecture.md +37 -19
- package/i18n/skills/a2h-utg-explorer/scripts/compile_tasks.mjs +48 -3
- package/i18n/skills/a2h-utg-explorer/scripts/final_utg.mjs +21 -0
- package/i18n/skills/a2h-utg-explorer/scripts/recover_d.mjs +67 -8
- package/i18n/skills/a2h-utg-explorer/scripts/tests/diagnostics.test.mjs +32 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/dialog_own_layout.test.mjs +40 -0
- package/i18n/skills/a2h-utg-explorer/scripts/utg_explorer/semantics.mjs +63 -2
- package/i18n/skills/a2h-utg-explorer/scripts/utg_explorer/task_runner.mjs +143 -14
- package/i18n/skills/a2h-utg-static/SKILL.md +3 -3
- package/i18n/skills/a2h-utg-static/references/ui-elements-static-utg-schema.md +4 -3
- package/i18n/skills/a2h-utg-static/scripts/click_paths.mjs +1 -1
- package/i18n/skills/a2h-utg-static/scripts/tests/test_compose_res_text.mjs +25 -0
- package/i18n/skills/a2h-utg-static/tools/convert_static_utg_to_ui_elements.ts +1 -0
- package/package.json +2 -1
- package/platforms/atomcode/skills/a2h-app-migrate/SKILL.unique.md +3 -0
- package/platforms/claude-code/skills/a2h-app-migrate/SKILL.unique.md +3 -0
- package/platforms/codebuddy/agents/build-fixer.frontmatter.md +5 -0
- package/platforms/codebuddy/agents/code-reviewer.frontmatter.md +5 -0
- package/platforms/codebuddy/agents/model-render-worker.frontmatter.md +5 -0
- package/platforms/codebuddy/agents/model-worker.frontmatter.md +5 -0
- package/platforms/codebuddy/agents/specgen-worker.frontmatter.md +5 -0
- package/platforms/codebuddy/skills/a2h-app-migrate/SKILL.unique.md +8 -0
- package/platforms/codex/skills/a2h-app-migrate/SKILL.unique.md +3 -0
- package/platforms/cursor/skills/a2h-app-migrate/SKILL.unique.md +3 -0
- package/platforms/deveco/agents/build-fixer.frontmatter.md +2 -0
- package/platforms/deveco/agents/code-reviewer.frontmatter.md +2 -0
- package/platforms/deveco/agents/model-render-worker.frontmatter.md +2 -0
- package/platforms/deveco/agents/model-worker.frontmatter.md +2 -0
- package/platforms/deveco/agents/specgen-worker.frontmatter.md +2 -0
- package/platforms/deveco/skills/a2h-app-migrate/SKILL.unique.md +3 -0
- package/platforms/opencode/agents/build-fixer.frontmatter.md +2 -0
- package/platforms/opencode/agents/code-reviewer.frontmatter.md +2 -0
- package/platforms/opencode/agents/model-render-worker.frontmatter.md +2 -0
- package/platforms/opencode/agents/model-worker.frontmatter.md +2 -0
- package/platforms/opencode/agents/specgen-worker.frontmatter.md +2 -0
- package/platforms/opencode/skills/a2h-app-migrate/SKILL.unique.md +10 -0
- package/platforms/qoder/skills/a2h-app-migrate/SKILL.unique.md +3 -0
- package/platforms/qoder-cn/skills/a2h-app-migrate/SKILL.unique.md +8 -0
- package/platforms/trae/skills/a2h-app-migrate/SKILL.unique.md +3 -0
- package/platforms/trae-cn/skills/a2h-app-migrate/SKILL.unique.md +3 -0
- package/skills/a2h-app-migrate/SKILL.md +31 -14
- package/skills/a2h-app-migrate/references/stage-map.md +4 -2
- package/skills/a2h-app-migrate/references/workflow.yaml +152 -89
- package/skills/a2h-app-migrate/scripts/assert_dag_complete.mjs +1 -1
- package/skills/a2h-app-migrate/scripts/check_ui_batch_done.mjs +28 -11
- package/skills/a2h-app-migrate/scripts/dag_action_catalog.mjs +76 -0
- package/skills/a2h-app-migrate/scripts/dag_production_executor.mjs +60 -5
- package/skills/a2h-app-migrate/scripts/dag_runner.mjs +184 -4
- package/skills/a2h-app-migrate/scripts/env_preflight.mjs +1 -1
- package/skills/a2h-app-migrate/scripts/ledger.mjs +2 -2
- package/skills/a2h-app-migrate/scripts/resume_plan.mjs +3 -3
- package/skills/a2h-app-migrate/scripts/validate_workflow.mjs +51 -2
- package/skills/a2h-app-migrate/test/test_dag_blocked_guard.mjs +291 -0
- package/skills/a2h-app-migrate/test/test_dag_production.mjs +40 -0
- package/skills/a2h-app-migrate/test/test_dag_runner.mjs +4 -3
- package/skills/a2h-app-migrate/test/test_i18n_engine_mirror.mjs +1 -1
- package/skills/a2h-app-migrate/test/test_interaction.mjs +0 -2
- package/skills/a2h-app-migrate/test/test_resume_plan.mjs +1 -1
- package/skills/a2h-app-migrate/test/test_skill_doc.mjs +1 -1
- package/skills/a2h-app-migrate/test/test_spec_engine_contract.mjs +1 -1
- package/skills/a2h-app-migrate/test/test_specs_json_preflight.mjs +1 -1
- package/skills/a2h-app-migrate/test/test_ui_batch_done.mjs +36 -0
- package/skills/a2h-app-migrate/test/test_utg_static_done.mjs +19 -6
- package/skills/a2h-app-migrate/test/test_validate_workflow_bilingual.mjs +4 -2
- package/skills/a2h-arkts-logic-coder/SKILL.md +8 -7
- package/skills/a2h-arkts-logic-coder/references/ISSUES.md +2 -2
- package/skills/a2h-arkts-logic-coder/references/code-generation.md +33 -12
- package/skills/a2h-batch-ui-align/SKILL.md +14 -12
- package/skills/a2h-batch-ui-align/references/cards/alignment.md +1 -0
- package/skills/a2h-batch-ui-align/references/cards/canvas.md +1 -0
- package/skills/a2h-batch-ui-align/references/cards/dynamics.md +32 -1
- package/skills/a2h-batch-ui-align/references/cards/geometry.md +3 -2
- package/skills/a2h-batch-ui-align/references/cards/interaction.md +4 -0
- package/skills/a2h-batch-ui-align/references/cards/resources.md +19 -1
- package/skills/a2h-batch-ui-align/references/cards/widgets.md +13 -1
- package/skills/a2h-batch-ui-align/references/cards/window.md +2 -2
- package/skills/a2h-batch-ui-align/references/checker-rules.md +205 -7
- package/skills/a2h-batch-ui-align/references/conversion-procedure.md +10 -17
- package/skills/a2h-batch-ui-align/references/incremental-scope.md +3 -4
- package/skills/a2h-batch-ui-align/references/lottie-integration.md +47 -2
- package/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-atomic-component-mapping-reference.md +52 -328
- package/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-interaction-mapping-reference.md +1 -138
- package/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-layout-mapping-reference.md +2 -11
- package/skills/a2h-batch-ui-align/references/state-mgmt/_/350/214/203/345/274/217/351/200/211/346/213/251/350/257/264/346/230/216.md +1 -1
- package/skills/a2h-batch-ui-align/references/step3-capture.md +8 -23
- package/skills/a2h-batch-ui-align/references/step4-prepare.md +2 -1
- package/skills/a2h-batch-ui-align/references/step5-convert.md +17 -9
- package/skills/a2h-batch-ui-align/scripts/build_conversion_set.mjs +239 -16
- package/skills/a2h-batch-ui-align/scripts/group_commit.mjs +6 -1
- package/skills/a2h-batch-ui-align/scripts/group_pack.mjs +6 -0
- package/skills/a2h-batch-ui-align/scripts/group_pass.mjs +270 -0
- package/skills/a2h-batch-ui-align/scripts/group_queue.mjs +134 -16
- package/skills/a2h-batch-ui-align/scripts/group_watch.mjs +39 -8
- package/skills/a2h-batch-ui-align/scripts/icon_coverage.mjs +6 -3
- package/skills/a2h-batch-ui-align/scripts/measure_pack.ts +170 -10
- package/skills/a2h-batch-ui-align/scripts/module_placement.mjs +189 -0
- package/skills/a2h-batch-ui-align/scripts/overlay_effects.mjs +205 -0
- package/skills/a2h-batch-ui-align/scripts/phase5_check.mjs +42 -1
- package/skills/a2h-batch-ui-align/scripts/static_check/main.ts +20 -1
- package/skills/a2h-batch-ui-align/scripts/static_check/registry.ts +28 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/attr_chain.ts +81 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/click_handler.ts +140 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/collapsing_toolbar.ts +124 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/compose_semantics.ts +287 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/flowitem_width.ts +78 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/hit_test.ts +194 -8
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/inset_stacked.ts +138 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/int_division.ts +181 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/layout_placement.ts +62 -2
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/lottie_path.ts +77 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/lottie_ready.ts +109 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/media_tint.ts +88 -18
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/relative_container_cycle.ts +140 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/relative_container_height.ts +2 -2
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/see_through_overlay.ts +149 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/sheet_builder.ts +139 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/sheet_show_close.ts +53 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/space_between_optional.ts +115 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/theme_color.ts +7 -1
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/width_fill.ts +160 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/scan_file.ts +28 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_chrome_defaults.test.mjs +328 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_click_handler.test.mjs +127 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_compose_semantics.test.mjs +150 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_hit_test.test.mjs +117 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_inset_stacked.test.mjs +155 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_layout_placement.test.mjs +60 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_rule_smoke.test.mjs +413 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_runtime_api.test.mjs +159 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_sheet_builder.test.mjs +192 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_theme.test.mjs +4 -2
- package/skills/a2h-batch-ui-align/scripts/tests/build_conversion_set.test.mjs +38 -0
- package/skills/a2h-batch-ui-align/scripts/tests/build_conversion_set_compose.test.mjs +106 -0
- package/skills/a2h-batch-ui-align/scripts/tests/group_commit.test.mjs +15 -0
- package/skills/a2h-batch-ui-align/scripts/tests/group_pass.test.mjs +150 -0
- package/skills/a2h-batch-ui-align/scripts/tests/group_queue.test.mjs +125 -0
- package/skills/a2h-batch-ui-align/scripts/tests/group_watch.test.mjs +56 -0
- package/skills/a2h-batch-ui-align/scripts/tests/measure_pack_icon_leaf.test.mjs +143 -0
- package/skills/a2h-batch-ui-align/scripts/tests/module_placement.test.mjs +248 -0
- package/skills/a2h-batch-ui-align/scripts/tests/overlay_effects.test.mjs +214 -0
- package/skills/a2h-fix-build-errors/references/known-patterns.md +5 -5
- package/skills/a2h-module-semantic-docs/SKILL.md +3 -2
- package/skills/a2h-module-semantic-docs/scripts/commit_module_state.mjs +10 -0
- package/skills/a2h-module-semantic-docs/scripts/design_baseline.mjs +158 -0
- package/skills/a2h-module-semantic-docs/test/test_design_baseline.mjs +128 -0
- package/skills/a2h-page-specgen/SKILL.md +36 -5
- package/skills/a2h-page-specgen/references/behavior-ledger.md +88 -21
- package/skills/a2h-page-specgen/references/evidence.md +2 -1
- package/skills/a2h-page-specgen/references/execution-model.md +13 -5
- package/skills/a2h-page-specgen/references/gates.md +33 -7
- package/skills/a2h-page-specgen/references/scenario-authoring.md +67 -13
- package/skills/a2h-page-specgen/references/spec-example.md +166 -32
- package/skills/a2h-page-specgen/references/spec-template.md +8 -5
- package/skills/a2h-page-specgen/scripts/behavior-audit.mjs +40 -2
- package/skills/a2h-page-specgen/scripts/behavior-discovery.mjs +241 -22
- package/skills/a2h-page-specgen/scripts/behavior-model.mjs +29 -2
- package/skills/a2h-page-specgen/scripts/behavior-reconcile.mjs +35 -2
- package/skills/a2h-page-specgen/scripts/contract-calls.mjs +715 -0
- package/skills/a2h-page-specgen/scripts/finalize.mjs +55 -2
- package/skills/a2h-page-specgen/scripts/footprint.mjs +129 -2
- package/skills/a2h-page-specgen/scripts/gate.mjs +20 -11
- package/skills/a2h-page-specgen/scripts/lib/contracts.mjs +56 -3
- package/skills/a2h-page-specgen/scripts/lib/graph-evidence.mjs +27 -0
- package/skills/a2h-page-specgen/scripts/lib/hg.mjs +114 -5
- package/skills/a2h-page-specgen/scripts/lib/ledger.mjs +20 -3
- package/skills/a2h-page-specgen/scripts/operation-evidence.mjs +270 -29
- package/skills/a2h-page-specgen/scripts/prepare.mjs +25 -14
- package/skills/a2h-page-specgen/scripts/report.mjs +26 -5
- package/skills/a2h-page-specgen/scripts/submission.mjs +69 -2
- package/skills/a2h-page-specgen/scripts/submit.mjs +105 -4
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.prompt.md +110 -18
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.worker.md +97 -12
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.prompt.md +110 -18
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.worker.md +97 -12
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.discovery.json +224 -224
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.json +1 -1
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.post-review.json +2 -2
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.prompt.md +110 -18
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.worker.md +97 -12
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.prompt.md +110 -18
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.worker.md +97 -12
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/run.mjs +153 -3
- package/skills/a2h-page-specgen/scripts/test/android-operation-evidence.test.mjs +529 -1
- package/skills/a2h-page-specgen/scripts/test/behavior-audit-pre.test.mjs +27 -0
- package/skills/a2h-page-specgen/scripts/test/behavior-discovery.test.mjs +158 -0
- package/skills/a2h-page-specgen/scripts/test/behavior-fixtures.mjs +11 -13
- package/skills/a2h-page-specgen/scripts/test/behavior-reconcile.test.mjs +97 -0
- package/skills/a2h-page-specgen/scripts/test/contract-calls.test.mjs +737 -0
- package/skills/a2h-page-specgen/scripts/test/contracts.test.mjs +82 -3
- package/skills/a2h-page-specgen/scripts/test/finalize.test.mjs +24 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/hg.mkdb.mjs +11 -0
- package/skills/a2h-page-specgen/scripts/test/footprint-resolve.test.mjs +6 -2
- package/skills/a2h-page-specgen/scripts/test/gate.test.mjs +94 -1
- package/skills/a2h-page-specgen/scripts/test/graph-evidence.test.mjs +32 -0
- package/skills/a2h-page-specgen/scripts/test/hg.test.mjs +14 -0
- package/skills/a2h-page-specgen/scripts/test/ledger.test.mjs +49 -1
- package/skills/a2h-page-specgen/scripts/test/operation-reviews.test.mjs +6 -1
- package/skills/a2h-page-specgen/scripts/test/prompt-tpl.test.mjs +12 -4
- package/skills/a2h-page-specgen/scripts/test/protocol-docs.test.mjs +1 -1
- package/skills/a2h-page-specgen/scripts/test/recovery-e2e.test.mjs +1 -0
- package/skills/a2h-page-specgen/scripts/test/report.test.mjs +80 -1
- package/skills/a2h-page-specgen/scripts/test/submit.test.mjs +159 -27
- package/skills/a2h-page-specgen/scripts/test/waker-process.test.mjs +23 -0
- package/skills/a2h-page-specgen/scripts/waker.mjs +8 -1
- package/skills/a2h-resource-convert/SKILL.md +1 -1
- package/skills/a2h-resource-convert/data/framework-strings/NOTICE +10 -0
- package/skills/a2h-resource-convert/data/framework-strings/manifest.json +90 -0
- package/skills/a2h-resource-convert/data/framework-strings/strings.json +382 -0
- package/skills/a2h-resource-convert/references/conversion-rules.md +7 -1
- package/skills/a2h-resource-convert/references/lottie-conversion-rules.md +2 -2
- package/skills/a2h-resource-convert/references/step5-reference-resolution.md +16 -0
- package/skills/a2h-resource-convert/scripts/a2h_resource_convert.ts +124 -8
- package/skills/a2h-resource-convert/scripts/sync-framework-strings.mjs +147 -0
- package/skills/a2h-resource-convert/scripts/tests/framework_strings.test.mjs +131 -0
- package/skills/a2h-spec-design-pipeline/SKILL.md +14 -11
- package/skills/a2h-spec-design-pipeline/references/coding-loop.md +38 -10
- package/skills/a2h-spec-design-pipeline/references/execution-model.md +3 -0
- package/skills/a2h-spec-design-pipeline/references/final-report-template.md +6 -3
- package/skills/a2h-spec-design-pipeline/references/initialization.md +2 -2
- package/skills/a2h-spec-design-pipeline/references/post-loop.md +2 -2
- package/skills/a2h-spec-design-pipeline/references/reply-recovery.md +172 -0
- package/skills/a2h-spec-design-pipeline/references/review-loop.md +2 -2
- package/skills/a2h-spec-design-pipeline/references/scripts.md +4 -3
- package/skills/a2h-spec-design-pipeline/references/shared-layer.md +24 -19
- package/skills/a2h-spec-design-pipeline/references/state-and-resume.md +7 -1
- package/skills/a2h-spec-design-pipeline/references/static-defect-gate.md +12 -5
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/config/ruleMeta.json +5 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/config/ruleSet.json +4 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/data/README.md +27 -3
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/data/api-param-contract.json +46 -1
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/data/api-permission-map.json +2511 -295
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/api-permission-declared-cn.md +27 -72
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/api-permission-declared-en.md +39 -83
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/arkui-runtime-pitfall-cn.md +132 -101
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/arkui-runtime-pitfall-en.md +158 -115
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/platform-api-contract-cn.md +60 -93
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/platform-api-contract-en.md +73 -100
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/route-page-side-effect-import-cn.md +52 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/route-page-side-effect-import-en.md +59 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/ApiPermissionDeclaredCheck.js +57 -8
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/ArkUIRuntimePitfallCheck.js +475 -18
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/PlatformApiContractCheck.js +472 -4
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/RoutePageSideEffectImportCheck.js +570 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/arkui/RouteParamCarrierSubCheck.js +1053 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/sql/SqlIdentifierAnalysis.js +427 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/index.js +7 -1
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/package.json +1 -1
- package/skills/a2h-spec-design-pipeline/scripts/plan_groups.ts +1 -1
- package/skills/a2h-spec-design-pipeline/scripts/settle.ts +785 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_api_permission_declared.ts +286 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_arkui_runtime_pitfall.ts +166 -2
- package/skills/a2h-spec-design-pipeline/scripts/test_docs_refresh_contract.ts +40 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_plan_groups.ts +2 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_platform_api_contract.ts +350 -7
- package/skills/a2h-spec-design-pipeline/scripts/test_route_page_side_effect_import.ts +185 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_route_param_carrier.ts +341 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_settle.ts +593 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_shared_layer_docs.ts +92 -1
- package/skills/a2h-spec-design-pipeline/scripts/test_sql_identifier_analysis.ts +137 -0
- package/skills/a2h-spec-generate/references/input-formats.md +1 -1
- package/skills/a2h-utg-explorer/SKILL.md +11 -5
- package/skills/a2h-utg-explorer/references/architecture.md +37 -19
- package/skills/a2h-utg-explorer/scripts/audit.mjs +6 -2
- package/skills/a2h-utg-explorer/scripts/close_phases.mjs +8 -5
- package/skills/a2h-utg-explorer/scripts/compile_tasks.mjs +95 -19
- package/skills/a2h-utg-explorer/scripts/d_prereqs.mjs +192 -4
- package/skills/a2h-utg-explorer/scripts/final_utg.mjs +21 -0
- package/skills/a2h-utg-explorer/scripts/panel_routes.mjs +1 -1
- package/skills/a2h-utg-explorer/scripts/plan.mjs +16 -1
- package/skills/a2h-utg-explorer/scripts/predicates.mjs +270 -0
- package/skills/a2h-utg-explorer/scripts/promote_dynamic.mjs +2 -0
- package/skills/a2h-utg-explorer/scripts/recover.mjs +4 -3
- package/skills/a2h-utg-explorer/scripts/recover_d.mjs +67 -8
- package/skills/a2h-utg-explorer/scripts/rejudge.mjs +4 -3
- package/skills/a2h-utg-explorer/scripts/report.mjs +32 -2
- package/skills/a2h-utg-explorer/scripts/run_cycle.mjs +103 -36
- package/skills/a2h-utg-explorer/scripts/run_device.mjs +3 -8
- package/skills/a2h-utg-explorer/scripts/schedule_states.mjs +189 -0
- package/skills/a2h-utg-explorer/scripts/tests/calendar_round_fixes.test.mjs +9 -0
- package/skills/a2h-utg-explorer/scripts/tests/coverage_rules.test.mjs +11 -0
- package/skills/a2h-utg-explorer/scripts/tests/d_prereqs.test.mjs +31 -2
- package/skills/a2h-utg-explorer/scripts/tests/device_lock_retry.test.mjs +1 -1
- package/skills/a2h-utg-explorer/scripts/tests/diagnostics.test.mjs +32 -0
- package/skills/a2h-utg-explorer/scripts/tests/dialog_own_layout.test.mjs +40 -0
- package/skills/a2h-utg-explorer/scripts/tests/explorer_review_fixes.test.mjs +4 -1
- package/skills/a2h-utg-explorer/scripts/tests/hybrid_route.test.mjs +6 -28
- package/skills/a2h-utg-explorer/scripts/tests/in_route_surface.test.mjs +125 -0
- package/skills/a2h-utg-explorer/scripts/tests/list_probe_target_wait.test.mjs +86 -0
- package/skills/a2h-utg-explorer/scripts/tests/multi_host.test.mjs +167 -0
- package/skills/a2h-utg-explorer/scripts/tests/nested_list.test.mjs +58 -0
- package/skills/a2h-utg-explorer/scripts/tests/overlay_opener.test.mjs +100 -0
- package/skills/a2h-utg-explorer/scripts/tests/pipeline.test.mjs +8 -1
- package/skills/a2h-utg-explorer/scripts/tests/pr169_review_fixes.test.mjs +1 -0
- package/skills/a2h-utg-explorer/scripts/tests/pr191_review_fixes.test.mjs +2 -31
- package/skills/a2h-utg-explorer/scripts/tests/review_fixes.test.mjs +1 -1
- package/skills/a2h-utg-explorer/scripts/tests/run_cycle.test.mjs +56 -7
- package/skills/a2h-utg-explorer/scripts/tests/snapshot_integrity.test.mjs +117 -6
- package/skills/a2h-utg-explorer/scripts/tests/state_inventory.test.mjs +414 -0
- package/skills/a2h-utg-explorer/scripts/tests/tree_unreliable.test.mjs +197 -0
- package/skills/a2h-utg-explorer/scripts/utg_explorer/adapters.mjs +196 -30
- package/skills/a2h-utg-explorer/scripts/utg_explorer/hosts.mjs +146 -0
- package/skills/a2h-utg-explorer/scripts/utg_explorer/semantics.mjs +63 -2
- package/skills/a2h-utg-explorer/scripts/utg_explorer/states.mjs +286 -0
- package/skills/a2h-utg-explorer/scripts/utg_explorer/task_runner.mjs +197 -19
- package/skills/a2h-utg-static/SKILL.md +3 -3
- package/skills/a2h-utg-static/references/extractors.md +7 -0
- package/skills/a2h-utg-static/references/ui-elements-static-utg-schema.md +4 -3
- package/skills/a2h-utg-static/scripts/click_paths.mjs +1 -1
- package/skills/a2h-utg-static/scripts/compose_overlay.mjs +642 -22
- package/skills/a2h-utg-static/scripts/tests/test_compose_res_text.mjs +25 -0
- package/skills/a2h-utg-static/scripts/tests/test_in_route_surface.mjs +123 -0
- package/skills/a2h-utg-static/scripts/tests/test_overlay_host_effects.mjs +239 -0
- package/skills/a2h-utg-static/scripts/tests/test_shared_host_depths.mjs +48 -0
- package/skills/a2h-utg-static/scripts/utg_html.mjs +2 -0
- package/skills/a2h-utg-static/tools/convert_static_utg_to_ui_elements.ts +1 -0
- package/i18n/skills/a2h-app-migrate/references/specs.example.json +0 -19
- package/i18n/skills/a2h-batch-ui-align/scripts/databinding_analyzer_design.md +0 -79
- package/i18n/skills/a2h-utg-explorer/scripts/utg_explorer/state_phase.mjs +0 -47
- package/resource/convert_pipeline_process.svg +0 -114
- package/resource/project_architecture.svg +0 -120
- package/resource/set_environment.png +0 -0
- package/resource/set_multimodel.png +0 -0
- package/skills/a2h-app-migrate/references/specs.example.json +0 -19
- package/skills/a2h-batch-ui-align/scripts/databinding_analyzer_design.md +0 -79
- package/skills/a2h-utg-explorer/scripts/utg_explorer/state_phase.mjs +0 -47
|
@@ -12,7 +12,9 @@ import path from "node:path";
|
|
|
12
12
|
import { fileURLToPath } from "node:url";
|
|
13
13
|
|
|
14
14
|
import yaml from "./lib-yaml-lite.mjs";
|
|
15
|
+
import { productionActionErrors } from "./dag_action_catalog.mjs";
|
|
15
16
|
import { validateGraph } from "./dag_graph.mjs";
|
|
17
|
+
import { evaluateSuccess } from "./dag_runner.mjs";
|
|
16
18
|
import { parseArgs } from "./paths_preflight.mjs";
|
|
17
19
|
|
|
18
20
|
const HERE = path.dirname(fileURLToPath(import.meta.url));
|
|
@@ -37,14 +39,18 @@ export const PROGRESS_POLICY_PHRASES_EN = [
|
|
|
37
39
|
|
|
38
40
|
/** Required phrases of ask_run_config_once.prompt_template, as [zh, en]. */
|
|
39
41
|
export const RUN_CONFIG_PROMPT_PHRASES = [
|
|
40
|
-
["不要向用户说明调度", "Do not explain scheduling to the user"],
|
|
41
|
-
["无 SCHEDULE_MODE", "no SCHEDULE_MODE"],
|
|
42
42
|
["禁止把人工检查闸门和运行方式放在同一次提问", "Never put the human check gates and the run mode in the same question"],
|
|
43
43
|
// not in i18n/terms.json; wording of the English workflow copy
|
|
44
44
|
["选了 auto 后不要再展示需要人工 check 的闸门", "After auto is chosen do not show gates that need a human check"],
|
|
45
45
|
["不答则默认全选", "selected by default"],
|
|
46
46
|
];
|
|
47
47
|
|
|
48
|
+
/** policy.human_interaction must keep the schedule-disclosure ban (platform overlays repeat it; the root must not lose it). */
|
|
49
|
+
export const SCHEDULE_DISCLOSURE_PHRASE = [
|
|
50
|
+
"不要向用户说明调度,也不要问串行或并行(无 SCHEDULE_MODE)",
|
|
51
|
+
"Do not explain scheduling to the user, and do not ask about serial or parallel (no SCHEDULE_MODE)",
|
|
52
|
+
];
|
|
53
|
+
|
|
48
54
|
/** policy.context_budget / skill-node invoke sentences, as [zh, en]. */
|
|
49
55
|
export const CONTEXT_BUDGET_PHRASE = ["禁止模型因上下文预算主动结束", "must not end the run on its own because of the context budget"];
|
|
50
56
|
export const NOT_A_STOP_SENTENCE = [
|
|
@@ -223,6 +229,43 @@ function pairKey(a, b) {
|
|
|
223
229
|
return [a, b].sort().join("\0");
|
|
224
230
|
}
|
|
225
231
|
|
|
232
|
+
function successPredicates(rules, out = new Set()) {
|
|
233
|
+
if (Array.isArray(rules)) {
|
|
234
|
+
for (const rule of rules) successPredicates(rule, out);
|
|
235
|
+
} else if (rules && typeof rules === "object") {
|
|
236
|
+
for (const [key, operand] of Object.entries(rules)) {
|
|
237
|
+
if (key === "when") continue;
|
|
238
|
+
out.add(key);
|
|
239
|
+
if (key === "all" || key === "any") successPredicates(operand, out);
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
return out;
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
/**
|
|
246
|
+
* Every success predicate, production runner.kind and lifecycle action (bootstrap / workspace / generic `actions`,
|
|
247
|
+
* skill before_run / after_run) the yaml names must be one the Runner / production executor implements. A mismatch
|
|
248
|
+
* otherwise surfaces only mid-run, as a blocked UNSUPPORTED_SUCCESS_RULE / UNSUPPORTED_PRODUCTION_ACTION on a customer machine.
|
|
249
|
+
*/
|
|
250
|
+
export function lifecycleSupportErrors(doc) {
|
|
251
|
+
const errors = [];
|
|
252
|
+
for (const node of doc.nodes || []) {
|
|
253
|
+
for (const predicate of successPredicates(node.success)) {
|
|
254
|
+
try {
|
|
255
|
+
// A null operand exercises only the predicate dispatch: supported predicates reject it with their own
|
|
256
|
+
// operand error (or return false) and never run a script.
|
|
257
|
+
evaluateSuccess({ [predicate]: null }, {});
|
|
258
|
+
} catch (error) {
|
|
259
|
+
if (error?.code === "UNSUPPORTED_SUCCESS_RULE" && /Unsupported success predicate/.test(String(error.message))) {
|
|
260
|
+
errors.push(`${node.id}: success predicate \`${predicate}\` is not implemented by dag_runner.mjs`);
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
if (node.runner?.action === "production") errors.push(...productionActionErrors(node));
|
|
265
|
+
}
|
|
266
|
+
return errors;
|
|
267
|
+
}
|
|
268
|
+
|
|
226
269
|
function main() {
|
|
227
270
|
const args = parseArgs(process.argv.slice(2), {
|
|
228
271
|
defaults: { yaml: DEFAULT_YAML },
|
|
@@ -472,6 +515,10 @@ function main() {
|
|
|
472
515
|
errors.push(`ask_run_config_once.prompt_template must state: ${pair[0]}`);
|
|
473
516
|
}
|
|
474
517
|
}
|
|
518
|
+
const humanPolicy = String(doc.policy?.human_interaction || "");
|
|
519
|
+
if (!hasPhrase(humanPolicy, SCHEDULE_DISCLOSURE_PHRASE)) {
|
|
520
|
+
errors.push(`policy.human_interaction must state: ${SCHEDULE_DISCLOSURE_PHRASE[0]}`);
|
|
521
|
+
}
|
|
475
522
|
if (prompt.includes("--schedule") || prompt.includes("schedule=parallel")) {
|
|
476
523
|
errors.push("ask_run_config_once.prompt_template must no longer mention --schedule / schedule=parallel");
|
|
477
524
|
}
|
|
@@ -594,6 +641,7 @@ function main() {
|
|
|
594
641
|
errors.push(`policy.user_facing is missing chat progress template phrase: ${phrase}`);
|
|
595
642
|
}
|
|
596
643
|
}
|
|
644
|
+
if (doc.id === "a2h-app-migrate") errors.push(...lifecycleSupportErrors(doc));
|
|
597
645
|
if (doc.id === "a2h-app-migrate") {
|
|
598
646
|
const budget = String(doc.policy?.context_budget || "");
|
|
599
647
|
if (!hasPhrase(budget, CONTEXT_BUDGET_PHRASE)) {
|
|
@@ -617,6 +665,7 @@ function main() {
|
|
|
617
665
|
process.stdout.write("✅ force_skip targets valid\n");
|
|
618
666
|
if (doc.id === "a2h-app-migrate") {
|
|
619
667
|
process.stdout.write("✅ all production nodes use the fixed Runner kinds/order; reuse, gates, summaries and finalize ownership are valid\n");
|
|
668
|
+
process.stdout.write("✅ every success predicate, production runner.kind and lifecycle action is implemented by the Runner / executor\n");
|
|
620
669
|
}
|
|
621
670
|
process.stdout.write(
|
|
622
671
|
`✅ no unregistered concurrent read/write races (${exempt.length} registered exemption(s), all still valid)\n`,
|
|
@@ -0,0 +1,291 @@
|
|
|
1
|
+
// A blocked run is a skill defect: it must stop for the user, the skill's scripts must not change under a run,
|
|
2
|
+
// and the yaml may only name success predicates / lifecycle actions the Runner and executor implement.
|
|
3
|
+
import assert from "node:assert/strict";
|
|
4
|
+
import { spawnSync } from "node:child_process";
|
|
5
|
+
import fs from "node:fs";
|
|
6
|
+
import os from "node:os";
|
|
7
|
+
import path from "node:path";
|
|
8
|
+
import test from "node:test";
|
|
9
|
+
import { fileURLToPath } from "node:url";
|
|
10
|
+
|
|
11
|
+
import { advance, blockedGuidance, loadRunState, startRun } from "../scripts/dag_runner.mjs";
|
|
12
|
+
import yaml from "../scripts/lib-yaml-lite.mjs";
|
|
13
|
+
import { lifecycleSupportErrors } from "../scripts/validate_workflow.mjs";
|
|
14
|
+
|
|
15
|
+
const HERE = path.dirname(fileURLToPath(import.meta.url));
|
|
16
|
+
const SKILL = path.join(HERE, "..");
|
|
17
|
+
const RUNNER = path.join(SKILL, "scripts", "dag_runner.mjs");
|
|
18
|
+
const EXECUTOR = path.join(SKILL, "scripts", "dag_production_executor.mjs");
|
|
19
|
+
const WORKFLOW = path.join(SKILL, "references", "workflow.yaml");
|
|
20
|
+
|
|
21
|
+
function flow(value) {
|
|
22
|
+
if (Array.isArray(value)) return `[${value.map(flow).join(", ")}]`;
|
|
23
|
+
if (value && typeof value === "object") {
|
|
24
|
+
return `{${Object.entries(value).map(([key, item]) => `${JSON.stringify(key)}: ${flow(item)}`).join(", ")}}`;
|
|
25
|
+
}
|
|
26
|
+
return JSON.stringify(value ?? null);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function writeDoc(root, doc) {
|
|
30
|
+
const workflow = path.join(root, "workflow.yaml");
|
|
31
|
+
fs.writeFileSync(workflow, `${Object.entries(doc).map(([key, value]) => `${key}: ${flow(value)}`).join("\n")}\n`);
|
|
32
|
+
return workflow;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// Exits without a result on its first call (EXECUTOR_EARLY_STOP → blocked), succeeds afterwards.
|
|
36
|
+
function earlyStopRun() {
|
|
37
|
+
const root = fs.mkdtempSync(path.join(os.tmpdir(), "dag-blocked-"));
|
|
38
|
+
const worker = path.join(root, "worker.mjs");
|
|
39
|
+
fs.writeFileSync(worker, `
|
|
40
|
+
import fs from "node:fs";
|
|
41
|
+
const req = JSON.parse(fs.readFileSync(process.env.A2H_DAG_REQUEST, "utf8"));
|
|
42
|
+
let n = 0; try { n = JSON.parse(fs.readFileSync(req.vars.COUNT, "utf8")); } catch {}
|
|
43
|
+
fs.writeFileSync(req.vars.COUNT, JSON.stringify(n + 1));
|
|
44
|
+
if (n === 0) process.exit(0);
|
|
45
|
+
fs.writeFileSync(process.env.A2H_DAG_RESULT, JSON.stringify({ attempt_id: req.attempt_id, status: "done" }));
|
|
46
|
+
`);
|
|
47
|
+
const workflow = writeDoc(root, { profiles: { full: { include_lanes: "all" } }, nodes: [{ id: "a", runner: { action: "external", retry: 1 } }] });
|
|
48
|
+
const runDir = path.join(root, "run");
|
|
49
|
+
const statePath = path.join(runDir, "dag-run-state.json");
|
|
50
|
+
startRun({
|
|
51
|
+
workflow, runDir, state: statePath, ledger: path.join(runDir, "stage-ledger.jsonl"), profile: "full",
|
|
52
|
+
vars: { COUNT: path.join(root, "count.json") }, executorCommand: `"${process.execPath}" "${worker}"`, executorTimeoutMs: 0,
|
|
53
|
+
});
|
|
54
|
+
return { root, statePath };
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function runnerCli(args) {
|
|
58
|
+
const out = spawnSync(process.execPath, [RUNNER, ...args], { encoding: "utf8" });
|
|
59
|
+
return { status: out.status, json: JSON.parse(out.stdout.trim().split(/\r?\n/).pop()) };
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
test("a blocked run does not resume without the user's confirmation, and the ack is recorded", async () => {
|
|
63
|
+
const { statePath } = earlyStopRun();
|
|
64
|
+
const blocked = await advance({ state: statePath });
|
|
65
|
+
assert.equal(blocked.status, "blocked");
|
|
66
|
+
assert.equal(blocked.error.code, "EXECUTOR_EARLY_STOP");
|
|
67
|
+
|
|
68
|
+
const refused = runnerCli(["continue", "--state", statePath]);
|
|
69
|
+
assert.equal(refused.status, 3);
|
|
70
|
+
assert.equal(refused.json.status, "blocked");
|
|
71
|
+
assert.equal(refused.json.error.code, "BLOCKED_NEEDS_USER_CONFIRMATION");
|
|
72
|
+
assert.equal(refused.json.blocked.requires_user_confirmation, true);
|
|
73
|
+
assert.match(refused.json.blocked.host_instruction, /Never modify/);
|
|
74
|
+
assert.equal(loadRunState(statePath).status, "blocked", "a refused continue leaves the run blocked");
|
|
75
|
+
|
|
76
|
+
const resumed = runnerCli(["continue", "--state", statePath, "--confirmed-by", "user"]);
|
|
77
|
+
assert.equal(resumed.json.status, "completed", JSON.stringify(resumed.json.error));
|
|
78
|
+
const acks = loadRunState(statePath).blocked_acks;
|
|
79
|
+
assert.equal(acks.length, 1);
|
|
80
|
+
assert.equal(acks[0].code, "EXECUTOR_EARLY_STOP");
|
|
81
|
+
assert.equal(acks[0].confirmed_by, "user");
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
test("a blocked runner result carries host guidance on stdout", async () => {
|
|
85
|
+
const { statePath } = earlyStopRun();
|
|
86
|
+
await advance({ state: statePath });
|
|
87
|
+
const status = spawnSync(process.execPath, [RUNNER, "continue", "--state", statePath], { encoding: "utf8" });
|
|
88
|
+
const json = JSON.parse(status.stdout.trim());
|
|
89
|
+
assert.equal(json.blocked.code, "BLOCKED_NEEDS_USER_CONFIRMATION");
|
|
90
|
+
assert.equal(json.blocked.blocked_on, "EXECUTOR_EARLY_STOP", "the guidance names what the run is actually blocked on");
|
|
91
|
+
assert.equal(json.blocked.category, "executor_error");
|
|
92
|
+
assert.equal(json.blocked.skill_defect, false);
|
|
93
|
+
assert.equal(json.blocked.requires_user_confirmation, true);
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
test("the run records the skill scripts' sha256 and blocks once any of them changes", async () => {
|
|
97
|
+
const { statePath } = earlyStopRun();
|
|
98
|
+
const state = loadRunState(statePath);
|
|
99
|
+
for (const file of ["scripts/dag_runner.mjs", "scripts/dag_production_executor.mjs", "scripts/dag_action_catalog.mjs"]) {
|
|
100
|
+
assert.match(state.integrity.files[file] || "", /^[0-9a-f]{64}$/, file);
|
|
101
|
+
}
|
|
102
|
+
// Simulate an edited runner: the recorded digest no longer matches the file on disk.
|
|
103
|
+
state.integrity.files["scripts/dag_runner.mjs"] = "0".repeat(64);
|
|
104
|
+
fs.writeFileSync(statePath, JSON.stringify(state, null, 2));
|
|
105
|
+
await assert.rejects(advance({ state: statePath, confirmedBy: "user" }), (error) => (
|
|
106
|
+
error.code === "SKILL_FILES_CHANGED" && error.exitCode === 3 && /changed: scripts\/dag_runner\.mjs/.test(error.message)
|
|
107
|
+
));
|
|
108
|
+
const cli = runnerCli(["continue", "--state", statePath, "--confirmed-by", "user"]);
|
|
109
|
+
assert.equal(cli.status, 3);
|
|
110
|
+
assert.equal(cli.json.error.code, "SKILL_FILES_CHANGED");
|
|
111
|
+
assert.equal(cli.json.blocked.requires_user_confirmation, true);
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
test("SKILLS_ROOT defaults to the runner's own install location", () => {
|
|
115
|
+
// The production workflow (the one a real migration runs) declares skill_root_var: SKILLS_ROOT.
|
|
116
|
+
const root = fs.mkdtempSync(path.join(os.tmpdir(), "dag-skills-root-"));
|
|
117
|
+
const target = { ANDROID: path.join(root, "android"), HMOS: path.join(root, "hmos") };
|
|
118
|
+
const start = (dir, vars) => startRun({
|
|
119
|
+
workflow: WORKFLOW, runDir: dir, state: path.join(dir, "dag-run-state.json"), ledger: path.join(root, "stage-ledger.jsonl"),
|
|
120
|
+
profile: "full", vars: { ...target, ...vars }, executorCommand: "", executorTimeoutMs: 0, resumeFrom: "", baseProfile: "",
|
|
121
|
+
});
|
|
122
|
+
const state = start(path.join(root, "control-1"), {});
|
|
123
|
+
assert.equal(path.resolve(state.vars.SKILLS_ROOT), path.resolve(SKILL, ".."));
|
|
124
|
+
assert.ok(!String(state.vars.LEDGER || "").startsWith("/a2h-app-migrate"), "no ${SKILLS_ROOT}-derived path renders against the drive root");
|
|
125
|
+
const explicit = start(path.join(root, "control-2"), { SKILLS_ROOT: "D:/custom/skills" });
|
|
126
|
+
assert.equal(explicit.vars.SKILLS_ROOT, "D:/custom/skills", "an explicit value wins");
|
|
127
|
+
});
|
|
128
|
+
|
|
129
|
+
function executorRequest(root, vars, beforeRun) {
|
|
130
|
+
const dagRunDir = path.join(root, "dag-control");
|
|
131
|
+
return {
|
|
132
|
+
run_id: "run-guard",
|
|
133
|
+
node: "ui.batch",
|
|
134
|
+
node_id: "ui.batch",
|
|
135
|
+
node_definition: { id: "ui.batch", actions: [], skill: "a2h-batch-ui-align", before_run: beforeRun, after_run: [] },
|
|
136
|
+
node_state: { generation: 0 },
|
|
137
|
+
runner: { action: "production", kind: "skill" },
|
|
138
|
+
invoke: "",
|
|
139
|
+
vars,
|
|
140
|
+
paths: { dag_run_dir: dagRunDir, ledger: path.join(root, "stage-ledger.jsonl"), state_path: path.join(dagRunDir, "dag-run-state.json") },
|
|
141
|
+
attempt_id: "run-guard:ui.batch:1",
|
|
142
|
+
attempt: { file_id: "attempt-1" },
|
|
143
|
+
request_path: path.join(dagRunDir, "attempts", "attempt-1.request.json"),
|
|
144
|
+
result_path: path.join(dagRunDir, "attempts", "attempt-1.result.json"),
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
function runExecutor(request) {
|
|
149
|
+
fs.mkdirSync(path.dirname(request.request_path), { recursive: true });
|
|
150
|
+
fs.writeFileSync(request.request_path, JSON.stringify(request));
|
|
151
|
+
const out = spawnSync(process.execPath, [EXECUTOR], {
|
|
152
|
+
env: { ...process.env, A2H_DAG_REQUEST: request.request_path, A2H_DAG_RESULT: request.result_path, A2H_DAG_ATTEMPT: request.attempt_id },
|
|
153
|
+
encoding: "utf8",
|
|
154
|
+
});
|
|
155
|
+
const result = fs.existsSync(request.result_path) ? JSON.parse(fs.readFileSync(request.result_path, "utf8")) : null;
|
|
156
|
+
return { status: out.status, stderr: out.stderr, result };
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
test("before_run honours `when` and incremental_scope fills SCOPE_ID only for incremental runs", () => {
|
|
160
|
+
const root = fs.mkdtempSync(path.join(os.tmpdir(), "dag-before-run-"));
|
|
161
|
+
const scopeScript = path.join(root, "scope.mjs");
|
|
162
|
+
fs.writeFileSync(scopeScript, `process.stdout.write(JSON.stringify({ scope_id: process.argv.includes("--empty") ? "" : "scope-42" }) + "\\n");`);
|
|
163
|
+
const action = (args) => ({ incremental_scope: { when: "${PROFILE} == incremental", script: scopeScript, runner: "node", args } });
|
|
164
|
+
|
|
165
|
+
const full = runExecutor(executorRequest(path.join(root, "full"), { PROFILE: "full" }, [action("--scope x.json")]));
|
|
166
|
+
assert.equal(full.status, 0, full.stderr);
|
|
167
|
+
assert.equal(full.result.status, "waiting_external", "a false `when` skips the action instead of blocking");
|
|
168
|
+
assert.equal(full.result.wait.vars.SCOPE_ID, undefined);
|
|
169
|
+
|
|
170
|
+
const incremental = runExecutor(executorRequest(path.join(root, "inc"), { PROFILE: "incremental" }, [action("--scope x.json")]));
|
|
171
|
+
assert.equal(incremental.status, 0, incremental.stderr);
|
|
172
|
+
assert.equal(incremental.result.status, "waiting_external");
|
|
173
|
+
assert.equal(incremental.result.wait.vars.SCOPE_ID, "scope-42");
|
|
174
|
+
assert.equal(incremental.result.wait.vars.SCOPE_JSON, "x.json");
|
|
175
|
+
|
|
176
|
+
const unconfirmed = runExecutor(executorRequest(path.join(root, "empty"), { PROFILE: "incremental" }, [action("--scope x.json --empty")]));
|
|
177
|
+
assert.equal(unconfirmed.result.status, "failed", "a missing scope is a business failure of the node, never an invented range");
|
|
178
|
+
assert.match(unconfirmed.result.reason, /incremental scope not confirmed/);
|
|
179
|
+
|
|
180
|
+
const unknown = runExecutor(executorRequest(path.join(root, "unknown"), { PROFILE: "full" }, [{ no_such_action: { when: "false" } }]));
|
|
181
|
+
assert.notEqual(unknown.status, 0);
|
|
182
|
+
assert.match(unknown.stderr, /UNSUPPORTED_PRODUCTION_ACTION/, "an unknown action is rejected even when its guard is false");
|
|
183
|
+
});
|
|
184
|
+
|
|
185
|
+
test("validate_workflow rejects success predicates and lifecycle actions the Runner / executor do not implement", () => {
|
|
186
|
+
const real = yaml.load(fs.readFileSync(WORKFLOW, "utf8"));
|
|
187
|
+
assert.deepEqual(lifecycleSupportErrors(real), [], "the shipped workflow.yaml is fully implemented");
|
|
188
|
+
|
|
189
|
+
const broken = structuredClone(real);
|
|
190
|
+
broken.nodes.find((n) => n.id === "bootstrap").success = [{ env_preflight_passed: true }];
|
|
191
|
+
broken.nodes.find((n) => n.id === "ui.batch").before_run.push({ brand_new_action: { args: "" } });
|
|
192
|
+
broken.nodes.find((n) => n.id === "enrich.spec_gen").after_run.push({ another_new_action: {} });
|
|
193
|
+
const errors = lifecycleSupportErrors(broken);
|
|
194
|
+
assert.ok(errors.some((e) => /bootstrap: success predicate `env_preflight_passed`/.test(e)), errors.join("\n"));
|
|
195
|
+
assert.ok(errors.some((e) => /ui\.batch: before_run action `brand_new_action`/.test(e)), errors.join("\n"));
|
|
196
|
+
assert.ok(errors.some((e) => /enrich\.spec_gen: after_run action `another_new_action`/.test(e)), errors.join("\n"));
|
|
197
|
+
});
|
|
198
|
+
|
|
199
|
+
test("a blocked state produced inside continue's own recovery is not auto-retried", async () => {
|
|
200
|
+
const { root, statePath } = earlyStopRun();
|
|
201
|
+
await advance({ state: statePath });
|
|
202
|
+
// Rebuild what a runner that died after the executor wrote an invalid result leaves behind: the node and its
|
|
203
|
+
// attempt still running, and a result file nobody processed.
|
|
204
|
+
const state = loadRunState(statePath);
|
|
205
|
+
const attempt = state.attempts.find((item) => item.attempt_id === state.nodes.a.current_attempt_id);
|
|
206
|
+
state.status = "running";
|
|
207
|
+
delete state.error;
|
|
208
|
+
state.nodes.a.status = "running";
|
|
209
|
+
delete state.nodes.a.error;
|
|
210
|
+
attempt.status = "running";
|
|
211
|
+
delete attempt.error;
|
|
212
|
+
fs.writeFileSync(statePath, JSON.stringify(state, null, 2));
|
|
213
|
+
fs.writeFileSync(attempt.result_path, "{ not json");
|
|
214
|
+
const calls = JSON.parse(fs.readFileSync(path.join(root, "count.json"), "utf8"));
|
|
215
|
+
|
|
216
|
+
const after = await advance({ state: statePath });
|
|
217
|
+
assert.equal(after.status, "blocked");
|
|
218
|
+
assert.equal(after.error.code, "EXECUTOR_INVALID_RESULT");
|
|
219
|
+
assert.equal(JSON.parse(fs.readFileSync(path.join(root, "count.json"), "utf8")), calls, "no new attempt was started");
|
|
220
|
+
await assert.rejects(advance({ state: statePath }), (error) => error.code === "BLOCKED_NEEDS_USER_CONFIRMATION");
|
|
221
|
+
assert.equal((await advance({ state: statePath, confirmedBy: "user" })).status, "completed");
|
|
222
|
+
});
|
|
223
|
+
|
|
224
|
+
test("an edited workflow.yaml is reported as blocked (exit 3) with skill-defect guidance", async () => {
|
|
225
|
+
const { root, statePath } = earlyStopRun();
|
|
226
|
+
fs.appendFileSync(path.join(root, "workflow.yaml"), "# edited during the run\n");
|
|
227
|
+
const cli = runnerCli(["continue", "--state", statePath, "--confirmed-by", "user"]);
|
|
228
|
+
assert.equal(cli.status, 3);
|
|
229
|
+
assert.equal(cli.json.status, "blocked");
|
|
230
|
+
assert.equal(cli.json.error.code, "WORKFLOW_CHANGED");
|
|
231
|
+
assert.equal(cli.json.blocked.category, "skill_defect");
|
|
232
|
+
assert.match(cli.json.blocked.host_instruction, /Never modify/);
|
|
233
|
+
});
|
|
234
|
+
|
|
235
|
+
test("a run keeps using the runner it started with", async () => {
|
|
236
|
+
const { statePath } = earlyStopRun();
|
|
237
|
+
const state = loadRunState(statePath);
|
|
238
|
+
state.integrity.root = path.join(os.tmpdir(), "some-other-copy", "a2h-app-migrate");
|
|
239
|
+
fs.writeFileSync(statePath, JSON.stringify(state, null, 2));
|
|
240
|
+
await assert.rejects(advance({ state: statePath, confirmedBy: "user" }), (error) => (
|
|
241
|
+
error.code === "SKILL_FILES_CHANGED" && error.exitCode === 3 && /started with the skill at/.test(error.message)
|
|
242
|
+
));
|
|
243
|
+
});
|
|
244
|
+
|
|
245
|
+
test("blocked guidance separates skill defects, business failures, executor errors and interruptions", () => {
|
|
246
|
+
const interrupted = blockedGuidance({ code: "RUNNER_INTERRUPTED", message: "stopped" });
|
|
247
|
+
assert.equal(interrupted.category, "interrupted");
|
|
248
|
+
assert.equal(interrupted.requires_user_confirmation, false);
|
|
249
|
+
assert.match(interrupted.host_instruction, /no user confirmation needed/);
|
|
250
|
+
|
|
251
|
+
const finalize = blockedGuidance({ code: "FINALIZE_FAILED", message: "logic.finalize failed", node: "logic.finalize" });
|
|
252
|
+
assert.equal(finalize.category, "business_failure");
|
|
253
|
+
assert.equal(finalize.skill_defect, false);
|
|
254
|
+
assert.equal(finalize.requires_user_confirmation, true);
|
|
255
|
+
|
|
256
|
+
const unsupported = blockedGuidance({ code: "EXECUTOR_EXIT", message: "Executor failed with exit code 2: UNSUPPORTED_PRODUCTION_ACTION: before_run x" });
|
|
257
|
+
assert.equal(unsupported.category, "skill_defect", "the executor's own rejection is a skill defect even behind EXECUTOR_EXIT");
|
|
258
|
+
|
|
259
|
+
const earlyStop = blockedGuidance({ code: "EXECUTOR_EARLY_STOP", message: "Executor exited without producing a result" });
|
|
260
|
+
assert.equal(earlyStop.category, "executor_error");
|
|
261
|
+
assert.match(earlyStop.host_instruction, /--result-file/);
|
|
262
|
+
for (const guidance of [finalize, unsupported, earlyStop]) assert.match(guidance.host_instruction, /Never modify/);
|
|
263
|
+
});
|
|
264
|
+
|
|
265
|
+
test("incremental_scope keeps a scope path with spaces intact", () => {
|
|
266
|
+
const root = fs.mkdtempSync(path.join(os.tmpdir(), "dag scope with space-"));
|
|
267
|
+
const scopeScript = path.join(root, "scope.mjs");
|
|
268
|
+
fs.writeFileSync(scopeScript, `process.stdout.write(JSON.stringify({ scope_id: "scope-7", argv: process.argv.slice(2) }) + "\\n");`);
|
|
269
|
+
const hmos = path.join(root, "My Harmony App");
|
|
270
|
+
const before = [{ incremental_scope: { when: "${PROFILE} == incremental", script: scopeScript, runner: "node", args: "scope-id --scope ${HMOS}/.hometrans/incremental/scope.json" } }];
|
|
271
|
+
const out = runExecutor(executorRequest(path.join(root, "ctl"), { PROFILE: "incremental", HMOS: hmos }, before));
|
|
272
|
+
assert.equal(out.status, 0, out.stderr);
|
|
273
|
+
assert.equal(out.result.status, "waiting_external", JSON.stringify(out.result));
|
|
274
|
+
assert.equal(out.result.wait.vars.SCOPE_JSON, `${hmos}/.hometrans/incremental/scope.json`);
|
|
275
|
+
});
|
|
276
|
+
|
|
277
|
+
test("validate_workflow covers bootstrap, workspace and generic actions and production kinds", () => {
|
|
278
|
+
const broken = structuredClone(yaml.load(fs.readFileSync(WORKFLOW, "utf8")));
|
|
279
|
+
const byKind = (kind) => broken.nodes.find((n) => n.runner?.action === "production" && n.runner.kind === kind);
|
|
280
|
+
byKind("bootstrap").actions.push({ brand_new_bootstrap_step: {} });
|
|
281
|
+
byKind("workspace").actions.push({ brand_new_workspace_step: "x" });
|
|
282
|
+
byKind("script").actions.push({ no_script_here: { args: "" } });
|
|
283
|
+
byKind("snapshot").actions.push({ scripted_step: { script: "x.mjs", args: "" } });
|
|
284
|
+
byKind("host_action").runner.kind = "teleport";
|
|
285
|
+
const errors = lifecycleSupportErrors(broken);
|
|
286
|
+
assert.ok(errors.some((e) => /bootstrap action `brand_new_bootstrap_step`/.test(e)), errors.join("\n"));
|
|
287
|
+
assert.ok(errors.some((e) => /workspace action `brand_new_workspace_step`/.test(e)), errors.join("\n"));
|
|
288
|
+
assert.ok(errors.some((e) => /script action `no_script_here`/.test(e)), errors.join("\n"));
|
|
289
|
+
assert.ok(!errors.some((e) => /scripted_step/.test(e)), "an action that names a script is runnable");
|
|
290
|
+
assert.ok(errors.some((e) => /runner\.kind `teleport`/.test(e)), errors.join("\n"));
|
|
291
|
+
});
|
|
@@ -367,6 +367,46 @@ test("callback errors leave the waiting result intact; host ok:false is the only
|
|
|
367
367
|
assert.equal(hostFailed.reason, "device lost");
|
|
368
368
|
});
|
|
369
369
|
|
|
370
|
+
test("skill wait carries the node's own dispatch; spec_gen resolves it by SPEC_ENGINE", () => {
|
|
371
|
+
const nodes = Object.fromEntries(originalWorkflow.nodes.map((n) => [n.id, n]));
|
|
372
|
+
const waitOf = (id, engine) => {
|
|
373
|
+
const root = fs.mkdtempSync(path.join(os.tmpdir(), "dag-production-dispatch-"));
|
|
374
|
+
const def = { ...nodes[id], before_run: [], after_run: [] };
|
|
375
|
+
const result = runProtocol(manualRequest(root, id, { kind: "skill" }, { SPEC_ENGINE: engine }, def));
|
|
376
|
+
assert.equal(result.status, "waiting_external", id);
|
|
377
|
+
return result.wait;
|
|
378
|
+
};
|
|
379
|
+
for (const id of ["discover.utg_static", "discover.arch", "ui.batch", "enrich.module_docs", "logic.spec_pipeline"]) {
|
|
380
|
+
assert.equal(waitOf(id, "page-specgen").dispatch, "task_subagent", id);
|
|
381
|
+
}
|
|
382
|
+
const pageSpecgen = waitOf("enrich.spec_gen", "page-specgen");
|
|
383
|
+
assert.equal(pageSpecgen.dispatch, "task_subagent");
|
|
384
|
+
assert.equal(pageSpecgen.skill, "a2h-page-specgen");
|
|
385
|
+
const specGenerate = waitOf("enrich.spec_gen", "spec-generate");
|
|
386
|
+
assert.equal(specGenerate.dispatch, "primary_skill_inline");
|
|
387
|
+
assert.equal(specGenerate.skill, "a2h-spec-generate");
|
|
388
|
+
|
|
389
|
+
// No dispatch field keeps the historical inline behaviour.
|
|
390
|
+
const root = fs.mkdtempSync(path.join(os.tmpdir(), "dag-production-dispatch-"));
|
|
391
|
+
const plain = runProtocol(manualRequest(root, "ui.batch", { kind: "skill" }, {}, { skill: "a2h-batch-ui-align", before_run: [], after_run: [] }));
|
|
392
|
+
assert.equal(plain.wait.dispatch, "primary_skill_inline");
|
|
393
|
+
});
|
|
394
|
+
|
|
395
|
+
test("an unparsable or unmatched dispatch is a config error that blocks, never a silent fallback", () => {
|
|
396
|
+
for (const [dispatch, engine] of [["sub_agent", "page-specgen"], ["task_subagent(SPEC_ENGINE=other)", "page-specgen"], ["task_subagent(ENGINE=x)| primary_skill_inline(SPEC_ENGINE=page-specgen)", "page-specgen"]]) {
|
|
397
|
+
const root = fs.mkdtempSync(path.join(os.tmpdir(), "dag-production-dispatch-bad-"));
|
|
398
|
+
const request = manualRequest(root, "ui.batch", { kind: "skill" }, { SPEC_ENGINE: engine }, { skill: "a2h-batch-ui-align", dispatch, before_run: [], after_run: [] });
|
|
399
|
+
writeJson(request.request_path, request);
|
|
400
|
+
const outcome = spawnSync(process.execPath, [EXECUTOR], {
|
|
401
|
+
env: { ...process.env, A2H_DAG_REQUEST: request.request_path, A2H_DAG_RESULT: request.result_path, A2H_DAG_ATTEMPT: request.attempt_id },
|
|
402
|
+
encoding: "utf8",
|
|
403
|
+
});
|
|
404
|
+
assert.notEqual(outcome.status, 0, dispatch);
|
|
405
|
+
assert.match(outcome.stderr, /INVALID_DISPATCH/, dispatch);
|
|
406
|
+
assert.equal(fs.existsSync(request.result_path), false, "no result is written; the Runner blocks");
|
|
407
|
+
}
|
|
408
|
+
});
|
|
409
|
+
|
|
370
410
|
test("skill action cursor resumes only an interrupted attempt, not a business retry", () => {
|
|
371
411
|
const root = fs.mkdtempSync(path.join(os.tmpdir(), "dag-production-cursor-"));
|
|
372
412
|
const countFile = path.join(root, "count.json");
|
|
@@ -214,7 +214,9 @@ test("protocol early-stop recovery does not consume the business retry budget",
|
|
|
214
214
|
assert.equal(r.state.status, "blocked");
|
|
215
215
|
assert.equal(r.state.error.code, "EXECUTOR_EARLY_STOP");
|
|
216
216
|
const runId = r.state.run_id;
|
|
217
|
-
|
|
217
|
+
// A blocked run resumes only with the user's explicit go-ahead.
|
|
218
|
+
await assert.rejects(advance({ state: r.statePath }), (error) => error.code === "BLOCKED_NEEDS_USER_CONFIRMATION");
|
|
219
|
+
const recovered = await advance({ state: r.statePath, confirmedBy: "user" });
|
|
218
220
|
assert.equal(recovered.status, "completed", JSON.stringify(recovered.error));
|
|
219
221
|
assert.equal(recovered.run_id, runId);
|
|
220
222
|
assert.equal(recovered.nodes.a.attempt_count, 3);
|
|
@@ -357,7 +359,6 @@ else { const n = count(); if (req.vars.RESUME_MODE && n === 3) {} else write({ s
|
|
|
357
359
|
runDir: resumedRunDir,
|
|
358
360
|
state: resumedState,
|
|
359
361
|
ledger: original.ledger,
|
|
360
|
-
profile: "resume",
|
|
361
362
|
resumeFrom: "c",
|
|
362
363
|
vars: { COUNT: count, A_ART: artifact, RESUME_MODE: true },
|
|
363
364
|
executorCommand: worker.command,
|
|
@@ -365,7 +366,7 @@ else { const n = count(); if (req.vars.RESUME_MODE && n === 3) {} else write({ s
|
|
|
365
366
|
const interrupted = await advance({ state: resumedState });
|
|
366
367
|
assert.equal(interrupted.status, "blocked");
|
|
367
368
|
assert.equal(interrupted.error.code, "EXECUTOR_EARLY_STOP");
|
|
368
|
-
const resumed = await advance({ state: resumedState });
|
|
369
|
+
const resumed = await advance({ state: resumedState, confirmedBy: "user" });
|
|
369
370
|
assert.equal(resumed.status, "completed_with_failures", JSON.stringify(resumed.error));
|
|
370
371
|
assert.equal(resumed.run_id, started.run_id);
|
|
371
372
|
assert.equal(resumed.nodes.a.status, "skipped");
|
|
@@ -22,7 +22,7 @@ test("the English workflow mirrors the engine wiring structurally", () => {
|
|
|
22
22
|
const enNode = en.nodes.find((n) => n.id === "enrich.spec_gen");
|
|
23
23
|
assert.deepEqual(enNode.skill_by_engine, zhNode.skill_by_engine);
|
|
24
24
|
assert.match(enNode.invoke, /══ SPEC_ENGINE=page-specgen ══/);
|
|
25
|
-
assert.match(String(en.policy.context_budget), /
|
|
25
|
+
assert.match(String(en.policy.context_budget), /SPEC_ENGINE=spec-generate/);
|
|
26
26
|
});
|
|
27
27
|
|
|
28
28
|
test("the English SKILL.md documents the SPEC_ENGINE knob", () => {
|
|
@@ -99,8 +99,6 @@ test("workflow: interaction vars go through preflight and are backfilled; gate l
|
|
|
99
99
|
assert.doesNotMatch(ask.prompt_template, /- `all`/);
|
|
100
100
|
assert.doesNotMatch(ask.prompt_template, /- `none`/);
|
|
101
101
|
assert.doesNotMatch(ask.prompt_template, /- `skip`/);
|
|
102
|
-
assert.match(ask.prompt_template, /不要向用户说明调度/);
|
|
103
|
-
assert.match(ask.prompt_template, /无 SCHEDULE_MODE/);
|
|
104
102
|
assert.doesNotMatch(ask.prompt_template, /向用户说明:本次以串行方式执行/);
|
|
105
103
|
assert.match(ask.prompt_template, /禁止把人工检查闸门和运行方式放在同一次提问/);
|
|
106
104
|
assert.match(ask.prompt_template, /选了 auto 后不要再展示需要人工 check 的闸门/);
|
|
@@ -158,7 +158,7 @@ test("bootstrap runs plan_resume first so the run dirs are resolved from the led
|
|
|
158
158
|
// args / when unchanged: still only consumes SKILLS_ROOT / LEDGER / FROM_NODE / RESUME_BASE_PROFILE
|
|
159
159
|
const plan = boot.actions.map((a) => a.plan_resume).find(Boolean);
|
|
160
160
|
assert.match(plan.args, /--ledger \$\{LEDGER\} --from-node \$\{FROM_NODE\}/);
|
|
161
|
-
assert.
|
|
161
|
+
assert.equal(plan.when, "${FROM_NODE} != 'bootstrap'");
|
|
162
162
|
assert.doesNotMatch(plan.exit_0, /last_engine/, "exit_0 no longer backfills the engine");
|
|
163
163
|
// The engine carry-over actions are gone: bootstrap has no resolve_last_engine / resolve_case_id
|
|
164
164
|
assert.equal(at("resolve_last_engine"), -1, names.join(","));
|
|
@@ -127,7 +127,7 @@ test("module_docs: the --scope project-source rationale names the field that act
|
|
|
127
127
|
test("the orchestrator must not end the run because the context budget is tight", () => {
|
|
128
128
|
const policy = doc.policy.context_budget;
|
|
129
129
|
assert.match(policy, /禁止模型因上下文预算主动结束/);
|
|
130
|
-
assert.match(policy, /
|
|
130
|
+
assert.match(policy, /primary 等子 agent 返回(派发调用阻塞)不算停下/);
|
|
131
131
|
assert.match(policy, /不得升格成整条流水线的主动收尾/);
|
|
132
132
|
assert.match(SKILL, /禁止模型因上下文预算主动结束/);
|
|
133
133
|
assert.match(SKILL, /policy\.context_budget/);
|
|
@@ -90,7 +90,7 @@ test("every prose run_dir.mjs call names the engine", () => {
|
|
|
90
90
|
});
|
|
91
91
|
|
|
92
92
|
test("context_budget / spec boundary / parallel rule name the engine split", () => {
|
|
93
|
-
assert.match(String(doc.policy.context_budget), /SPEC_ENGINE=
|
|
93
|
+
assert.match(String(doc.policy.context_budget), /SPEC_ENGINE=spec-generate/);
|
|
94
94
|
assert.match(String(doc.policy.spec_order_boundary), /page-specgen/);
|
|
95
95
|
assert.match(String(doc.policy.spec_order_boundary), /finalize\.mjs/);
|
|
96
96
|
assert.match(String(doc.policy.parallel_rule), /SPEC_ENGINE/);
|
|
@@ -50,7 +50,7 @@ test("workflow: explicit specs_json skips spec generation and is kept by adopt",
|
|
|
50
50
|
const doc = yaml.load(fs.readFileSync(WORKFLOW, "utf8"));
|
|
51
51
|
assert.match(doc.vars.SKIP_SPEC_GENERATE.set_true_when, /specs_json/);
|
|
52
52
|
assert.equal(doc.profiles["logic-only"], undefined);
|
|
53
|
-
assert.deepEqual(doc.vars.PROFILE.choices, ["full", "ui-only", "incremental"
|
|
53
|
+
assert.deepEqual(doc.vars.PROFILE.choices, ["full", "ui-only", "incremental"]);
|
|
54
54
|
const byId = Object.fromEntries(doc.nodes.map((n) => [n.id, n]));
|
|
55
55
|
assert.match(byId["enrich.spec_gen"].skip_if, /SKIP_SPEC_GENERATE/);
|
|
56
56
|
assert.match(byId["review.spec_gen"].skip_if, /SKIP_SPEC_GENERATE/);
|
|
@@ -63,3 +63,39 @@ test("a conversion group still queued or running in queue_state.json is not reus
|
|
|
63
63
|
fs.writeFileSync(q, JSON.stringify({ groups: { G004: { state: "verified" }, G005: { state: "skipped" } } }));
|
|
64
64
|
assert.equal(checkUiBatch(hmos).code, 0);
|
|
65
65
|
});
|
|
66
|
+
|
|
67
|
+
// ui.batch success under profile=incremental: the progress says incremental, the node passes --mode incremental
|
|
68
|
+
test("--mode incremental accepts a finished incremental batch and still rejects pending pages", () => {
|
|
69
|
+
assert.equal(checkUiBatch(hmosWith({ mode: "incremental", pages }), { mode: "incremental" }).code, 0);
|
|
70
|
+
const pend = checkUiBatch(hmosWith({ mode: "incremental", pages: { a: { status: "pending" } } }), { mode: "incremental" });
|
|
71
|
+
assert.equal(pend.code, 1);
|
|
72
|
+
assert.match(pend.result.reason, /pending/);
|
|
73
|
+
assert.equal(checkUiBatch(hmosWith({ mode: "full", pages }), { mode: "incremental" }).code, 1);
|
|
74
|
+
const r = spawnSync(process.execPath, [SCRIPT, "--hmos", hmosWith({ mode: "incremental", pages }), "--mode", "incremental"], { encoding: "utf8" });
|
|
75
|
+
assert.equal(r.status, 0, r.stdout + r.stderr);
|
|
76
|
+
assert.equal(spawnSync(process.execPath, [SCRIPT, "--hmos", hmosWith({ mode: "full", pages }), "--mode", "bogus"], { encoding: "utf8" }).status, 2);
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
test("pending, blocked and returned (unverified) groups are open too", () => {
|
|
80
|
+
const hmos = hmosWith({ mode: "full", pages });
|
|
81
|
+
const q = path.join(hmos, ".hometrans", "queue_state.json");
|
|
82
|
+
fs.writeFileSync(q, JSON.stringify({ groups: { G003: { state: "blocked" }, G004: { state: "returned" }, G005: { state: "failed" } } }));
|
|
83
|
+
const r = checkUiBatch(hmos);
|
|
84
|
+
assert.equal(r.code, 1);
|
|
85
|
+
assert.deepEqual(r.result.groups_waiting, ["G003:blocked", "G004:returned"]);
|
|
86
|
+
// init re-queues a group whose pages failed last time as pending: its failed pages do not show it is unconverted
|
|
87
|
+
fs.writeFileSync(q, JSON.stringify({ groups: { G002: { state: "pending" }, G001: { state: "verified" } } }));
|
|
88
|
+
assert.deepEqual(checkUiBatch(hmosWith({ mode: "full", pages: { b: { status: "failed" } } })).code, 0);
|
|
89
|
+
const again = checkUiBatch(hmos);
|
|
90
|
+
assert.equal(again.code, 1);
|
|
91
|
+
assert.deepEqual(again.result.groups_waiting, ["G002:pending"]);
|
|
92
|
+
});
|
|
93
|
+
|
|
94
|
+
test("ui.batch success passes --mode incremental only under profile=incremental", () => {
|
|
95
|
+
const doc = yaml.load(fs.readFileSync(WORKFLOW, "utf8"));
|
|
96
|
+
const node = doc.nodes.find((n) => n.id === "ui.batch");
|
|
97
|
+
const branches = node.success[0].any.filter((b) => b.when);
|
|
98
|
+
const argsFor = (when) => branches.find((b) => b.when === when).all.find((r) => r.script_exit_0).script_exit_0.args;
|
|
99
|
+
assert.doesNotMatch(argsFor("${PROFILE} != incremental"), /--mode/);
|
|
100
|
+
assert.match(argsFor("${PROFILE} == incremental"), /--mode incremental/);
|
|
101
|
+
});
|
|
@@ -120,22 +120,35 @@ test("workflow: every REUSE_* used by a node is mapped to probe entries; resume_
|
|
|
120
120
|
assert.equal("CONVERSION_MODE" in doc.vars, false);
|
|
121
121
|
});
|
|
122
122
|
|
|
123
|
-
test("workflow: module_docs is
|
|
123
|
+
test("workflow: module_docs is a task_subagent; background notices are never gate confirmations", () => {
|
|
124
124
|
const doc = yaml.load(fs.readFileSync(WORKFLOW, "utf8"));
|
|
125
125
|
const byId = Object.fromEntries(doc.nodes.map((n) => [n.id, n]));
|
|
126
|
-
assert.
|
|
127
|
-
assert.doesNotMatch(byId["enrich.module_docs"].dispatch, /task_subagent/);
|
|
126
|
+
assert.equal(byId["enrich.module_docs"].dispatch, "task_subagent");
|
|
128
127
|
assert.match(doc.policy.human_gate_protocol, /通知不是答复/);
|
|
129
128
|
for (const id of ["review.arch", "review.spec_gen", "review.ui_batch"]) {
|
|
130
129
|
assert.match(byId[id].invoke, /按 policy\.human_gate_protocol/, id);
|
|
131
130
|
}
|
|
132
131
|
});
|
|
133
132
|
|
|
134
|
-
test("workflow:
|
|
133
|
+
test("workflow: every skill node is dispatched as a sub-agent; the primary only orchestrates", () => {
|
|
135
134
|
const doc = yaml.load(fs.readFileSync(WORKFLOW, "utf8"));
|
|
136
135
|
const byId = Object.fromEntries(doc.nodes.map((n) => [n.id, n]));
|
|
137
|
-
|
|
138
|
-
|
|
136
|
+
for (const id of ["discover.arch", "discover.utg_static", "ui.batch", "enrich.module_docs", "logic.spec_pipeline"]) {
|
|
137
|
+
assert.equal(byId[id].dispatch, "task_subagent", id);
|
|
138
|
+
}
|
|
139
|
+
// spec-generate completes workers on notifications and has no foreground wait mode: it stays inline.
|
|
140
|
+
assert.match(byId["enrich.spec_gen"].dispatch, /task_subagent(SPEC_ENGINE=page-specgen)/);
|
|
141
|
+
assert.match(byId["enrich.spec_gen"].dispatch, /primary_skill_inline(SPEC_ENGINE=spec-generate)/);
|
|
142
|
+
assert.equal("dispatch_inline" in doc.policy, false);
|
|
143
|
+
assert.match(doc.policy.dispatch, /不加载\*\*任何叶子 skill/);
|
|
144
|
+
assert.match(doc.policy.dispatch, /needs_input/);
|
|
145
|
+
// A sub-agent that ends its turn returns to the primary: the event-loop leaves must wait in the foreground.
|
|
146
|
+
assert.match(byId["enrich.spec_gen"].invoke, /wait_mode=foreground/);
|
|
147
|
+
assert.match(byId["logic.spec_pipeline"].invoke, /WAIT_MODE=foreground/);
|
|
148
|
+
assert.doesNotMatch(byId["logic.spec_pipeline"].invoke, /结束本轮\*\*等完成通知/);
|
|
149
|
+
for (const id of ["ui.batch", "logic.spec_pipeline", "discover.utg_static"]) {
|
|
150
|
+
assert.doesNotMatch(byId[id].invoke, /在 primary 内联|本会话是 primary|内联在 primary/, id);
|
|
151
|
+
}
|
|
139
152
|
});
|
|
140
153
|
|
|
141
154
|
test("uni-app: _uniapp_bootstrap records rc (not returncode) — rc 0 is success, rc ≠ 0 is a failure", () => {
|