@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
|
@@ -1,17 +1,25 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/**
|
|
3
|
-
* ui.batch reusability check -- the check script for item 4 of the bootstrap probe table
|
|
3
|
+
* ui.batch reusability check -- the check script for item 4 of the bootstrap probe table, and the
|
|
4
|
+
* success check of the ui.batch node itself.
|
|
4
5
|
*
|
|
5
|
-
* node check_ui_batch_done.mjs --hmos <HMOS>
|
|
6
|
+
* node check_ui_batch_done.mjs --hmos <HMOS> [--mode full|incremental]
|
|
7
|
+
*
|
|
8
|
+
* --mode is the mode the batch must have run in (default full, what the probe needs). The ui.batch node
|
|
9
|
+
* passes incremental under profile=incremental: there the report and the progress file say incremental,
|
|
10
|
+
* and the same checks (no pending page, no open group) decide whether this round's pages are finished.
|
|
6
11
|
*
|
|
7
12
|
* Looking only at whether batch_report.md exists misjudges: a2h-batch-ui-align in incremental mode writes the same report and records
|
|
8
13
|
* mode: incremental in batch_progress.json. Previously, after a single page had been migrated incrementally, a later migrate with REUSE_ALL=all
|
|
9
14
|
* treated the UI as done and skipped it, so the full UI was never converted. So finished =
|
|
10
15
|
* 1) <HMOS>/.hometrans/batch_report.md exists;
|
|
11
|
-
* 2) batch_progress.json's mode is full (old files without a mode field are treated as full);
|
|
16
|
+
* 2) batch_progress.json's mode is the expected one, full by default (old files without a mode field are treated as full);
|
|
12
17
|
* 3) no pending pages (failed pages are a legal ui-align terminal state, shown by review.ui_batch);
|
|
13
|
-
* 4) no conversion group still
|
|
14
|
-
* capture is re-queued when the capture lands; a report written
|
|
18
|
+
* 4) no conversion group still open in queue_state.json: pending, queued, running, blocked or returned (not yet verified).
|
|
19
|
+
* T4: a group converted source-only before its capture is re-queued when the capture lands; a report written
|
|
20
|
+
* before that redo is not the finished UI. Same open set as group_queue.mjs status --assert-settled.
|
|
21
|
+
* 3) does not cover a pending group: init re-queues a group whose pages failed last time as pending,
|
|
22
|
+
* and its failed pages pass 3.
|
|
15
23
|
*
|
|
16
24
|
* Read-only. stdout is one JSON line. Exit codes: 0 -- reusable; 1 -- not reusable (reason); 2 -- bad arguments
|
|
17
25
|
*/
|
|
@@ -24,7 +32,11 @@ import { parseArgs } from "./paths_preflight.mjs";
|
|
|
24
32
|
import { readJson } from "./json_io.mjs";
|
|
25
33
|
import { summarizeProgress } from "./human_review_gate.mjs";
|
|
26
34
|
|
|
27
|
-
|
|
35
|
+
/** Group states that still owe work: the same set as group_queue.mjs OPEN_STATES. */
|
|
36
|
+
const OPEN_GROUP_STATES = new Set(["pending", "queued", "running", "blocked", "returned"]);
|
|
37
|
+
export const MODES = ["full", "incremental"];
|
|
38
|
+
|
|
39
|
+
export function checkUiBatch(hmos, { mode: expected = "full" } = {}) {
|
|
28
40
|
const dir = path.join(hmos, ".hometrans");
|
|
29
41
|
const report = path.join(dir, "batch_report.md");
|
|
30
42
|
const progress = path.join(dir, "batch_progress.json");
|
|
@@ -38,7 +50,11 @@ export function checkUiBatch(hmos) {
|
|
|
38
50
|
} catch {
|
|
39
51
|
/* summarizeProgress has already parsed it once; this cannot fail */
|
|
40
52
|
}
|
|
41
|
-
if (mode !==
|
|
53
|
+
if (mode !== expected) {
|
|
54
|
+
return no(expected === "full"
|
|
55
|
+
? `batch_progress.json mode is ${mode}: an incremental migration report does not mean the full UI is done`
|
|
56
|
+
: `batch_progress.json mode is ${mode}, expected ${expected}`, { mode });
|
|
57
|
+
}
|
|
42
58
|
if (stats.pending > 0) {
|
|
43
59
|
return no(`${stats.pending} page(s) still pending (total ${stats.total})`, { mode, pending: stats.pendingIds.slice(0, 10) });
|
|
44
60
|
}
|
|
@@ -47,18 +63,19 @@ export function checkUiBatch(hmos) {
|
|
|
47
63
|
queue = readJson(path.join(dir, "queue_state.json"));
|
|
48
64
|
} catch { /* no queue (an older run, or a run without Step 5's queue): nothing more to check */ }
|
|
49
65
|
const waiting = Object.entries(queue?.groups ?? {})
|
|
50
|
-
.filter(([, g]) => g && (g.state
|
|
66
|
+
.filter(([, g]) => g && OPEN_GROUP_STATES.has(g.state))
|
|
51
67
|
.map(([gid, g]) => `${gid}:${g.state}`);
|
|
52
68
|
if (waiting.length) {
|
|
53
|
-
return no(`${waiting.length} conversion group(s) still queued
|
|
69
|
+
return no(`${waiting.length} conversion group(s) still open (pending / queued / running / blocked / not verified, e.g. re-queued after their capture landed): ${waiting.slice(0, 10).join(", ")}`,
|
|
54
70
|
{ mode, groups_waiting: waiting.slice(0, 20) });
|
|
55
71
|
}
|
|
56
72
|
return { code: 0, result: { done: true, mode, pages_total: stats.total, pages_done: stats.done, pages_failed: stats.failed } };
|
|
57
73
|
}
|
|
58
74
|
|
|
59
75
|
function main() {
|
|
60
|
-
const args = parseArgs(process.argv.slice(2), { required: ["hmos"] });
|
|
61
|
-
|
|
76
|
+
const args = parseArgs(process.argv.slice(2), { required: ["hmos"], defaults: { mode: "full" } });
|
|
77
|
+
if (!MODES.includes(args.mode)) throw new Error(`--mode must be one of ${MODES.join(" / ")}, got "${args.mode}"`);
|
|
78
|
+
const { code, result } = checkUiBatch(args.hmos, { mode: args.mode });
|
|
62
79
|
process.stdout.write(JSON.stringify({ hmos: args.hmos.replace(/\\/g, "/"), ...result }) + "\n");
|
|
63
80
|
return code;
|
|
64
81
|
}
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The production node kinds and lifecycle actions the production executor implements.
|
|
3
|
+
*
|
|
4
|
+
* Single source for dag_production_executor.mjs (rejects anything else as UNSUPPORTED_PRODUCTION_ACTION /
|
|
5
|
+
* UNSUPPORTED_PRODUCTION_KIND) and validate_workflow.mjs (rejects a workflow.yaml that names an action the executor
|
|
6
|
+
* cannot run), so a yaml/code mismatch fails the static check instead of blocking a customer run half-way through.
|
|
7
|
+
* Gate nodes (runner.kind: gate) run their own fixed lifecycle and are not covered here.
|
|
8
|
+
*/
|
|
9
|
+
export const PRODUCTION_KINDS = new Set([
|
|
10
|
+
"bootstrap", "workspace", "script", "snapshot", "adopt_specs", "skill", "gate", "host_action", "barrier",
|
|
11
|
+
]);
|
|
12
|
+
|
|
13
|
+
/** `actions` of runner.kind: bootstrap. */
|
|
14
|
+
export const BOOTSTRAP_ACTIONS = new Set([
|
|
15
|
+
"plan_resume",
|
|
16
|
+
"infer_android_root",
|
|
17
|
+
"infer_android_root_after_config",
|
|
18
|
+
"resolve_run_dir_show",
|
|
19
|
+
"describe_run_dir",
|
|
20
|
+
"probe_all_artifacts",
|
|
21
|
+
"ask_run_config_once",
|
|
22
|
+
"run_env_preflight",
|
|
23
|
+
"set_vars_from_preflight",
|
|
24
|
+
"incremental_history",
|
|
25
|
+
"incremental_diagnose",
|
|
26
|
+
"probe_image_read",
|
|
27
|
+
"tip_image_read_false",
|
|
28
|
+
]);
|
|
29
|
+
|
|
30
|
+
/** `actions` of runner.kind: workspace. */
|
|
31
|
+
export const WORKSPACE_ACTIONS = new Set(["ensure_dirs", "init_manifest", "init_ledger", "clear_stale_resume_summaries"]);
|
|
32
|
+
|
|
33
|
+
/**
|
|
34
|
+
* `actions` of runner.kind: script | snapshot | adopt_specs. Any action whose body names a `script` runs that
|
|
35
|
+
* script; only these names have a built-in implementation without one.
|
|
36
|
+
*/
|
|
37
|
+
export const GENERIC_KINDS = new Set(["script", "snapshot", "adopt_specs"]);
|
|
38
|
+
export const GENERIC_BUILTIN_ACTIONS = new Set(["adopt_batch_specs_json", "freeze_order"]);
|
|
39
|
+
|
|
40
|
+
/** before_run / after_run of runner.kind: skill. */
|
|
41
|
+
export const SKILL_BEFORE_RUN_ACTIONS = new Set([
|
|
42
|
+
"clear_gate_checkpoint",
|
|
43
|
+
"mark_module_docs_start",
|
|
44
|
+
"incremental_scope",
|
|
45
|
+
"resolve_run_dir",
|
|
46
|
+
"archive_stale_campaign",
|
|
47
|
+
]);
|
|
48
|
+
|
|
49
|
+
export const SKILL_AFTER_RUN_ACTIONS = new Set(["refresh_run_dir"]);
|
|
50
|
+
|
|
51
|
+
/** Errors for a production node whose runner.kind or lifecycle actions the executor does not implement. */
|
|
52
|
+
export function productionActionErrors(node) {
|
|
53
|
+
const kind = node?.runner?.kind;
|
|
54
|
+
const errors = [];
|
|
55
|
+
const named = (action) => Object.keys(action || {})[0] || "";
|
|
56
|
+
if (!PRODUCTION_KINDS.has(kind)) {
|
|
57
|
+
errors.push(`${node.id}: runner.kind \`${kind}\` is not implemented by dag_production_executor.mjs`);
|
|
58
|
+
return errors;
|
|
59
|
+
}
|
|
60
|
+
const check = (list, catalog, label) => {
|
|
61
|
+
for (const action of list || []) {
|
|
62
|
+
const name = named(action);
|
|
63
|
+
if (!catalog(name, action?.[name])) errors.push(`${node.id}: ${label} action \`${name}\` is not implemented by dag_production_executor.mjs`);
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
if (kind === "bootstrap") check(node.actions, (name) => BOOTSTRAP_ACTIONS.has(name), "bootstrap");
|
|
67
|
+
if (kind === "workspace") check(node.actions, (name) => WORKSPACE_ACTIONS.has(name), "workspace");
|
|
68
|
+
if (GENERIC_KINDS.has(kind)) {
|
|
69
|
+
check(node.actions, (name, body) => GENERIC_BUILTIN_ACTIONS.has(name) || Boolean(body && typeof body === "object" && body.script), kind);
|
|
70
|
+
}
|
|
71
|
+
if (kind === "skill") {
|
|
72
|
+
check(node.before_run, (name) => SKILL_BEFORE_RUN_ACTIONS.has(name), "before_run");
|
|
73
|
+
check(node.after_run, (name) => SKILL_AFTER_RUN_ACTIONS.has(name), "after_run");
|
|
74
|
+
}
|
|
75
|
+
return errors;
|
|
76
|
+
}
|
|
@@ -17,6 +17,9 @@ import fs from "node:fs";
|
|
|
17
17
|
import path from "node:path";
|
|
18
18
|
import { fileURLToPath } from "node:url";
|
|
19
19
|
|
|
20
|
+
import {
|
|
21
|
+
BOOTSTRAP_ACTIONS, SKILL_AFTER_RUN_ACTIONS, SKILL_BEFORE_RUN_ACTIONS, WORKSPACE_ACTIONS,
|
|
22
|
+
} from "./dag_action_catalog.mjs";
|
|
20
23
|
import { evaluateExpression } from "./dag_graph.mjs";
|
|
21
24
|
import { readJson, writeJsonAtomic } from "./json_io.mjs";
|
|
22
25
|
|
|
@@ -45,6 +48,29 @@ function businessFailure(request, error) {
|
|
|
45
48
|
return { attempt_id: request.attempt_id, status: "failed", reason: `${error.code}: ${error.message}` };
|
|
46
49
|
}
|
|
47
50
|
|
|
51
|
+
const DISPATCH_MODES = new Set(["task_subagent", "primary_skill_inline"]);
|
|
52
|
+
|
|
53
|
+
// How the host should run a skill wait, taken from the node's own `dispatch` (workflow.yaml policy.dispatch).
|
|
54
|
+
// Plain form: `dispatch: "task_subagent"`. Per-engine form (enrich.spec_gen only):
|
|
55
|
+
// `task_subagent(SPEC_ENGINE=page-specgen)| primary_skill_inline(SPEC_ENGINE=spec-generate)`
|
|
56
|
+
// A missing field keeps the historical inline behaviour; anything unparsable is a config error (Runner blocks),
|
|
57
|
+
// never a silent fallback. The host may still fall back to inline when it has no Task tool (policy.dispatch).
|
|
58
|
+
function resolveDispatch(request, vars) {
|
|
59
|
+
const raw = request.node_definition.dispatch;
|
|
60
|
+
if (raw === undefined || raw === null || raw === "") return "primary_skill_inline";
|
|
61
|
+
const text = String(raw).trim();
|
|
62
|
+
if (!text.includes("|")) {
|
|
63
|
+
if (!DISPATCH_MODES.has(text)) throw new ProductionError("INVALID_DISPATCH", `${request.node}: unknown dispatch "${text}"`);
|
|
64
|
+
return text;
|
|
65
|
+
}
|
|
66
|
+
for (const part of text.split("|")) {
|
|
67
|
+
const m = part.trim().match(/^([a-z_]+)\s*[((]\s*SPEC_ENGINE\s*=\s*([\w-]+)\s*[))]$/);
|
|
68
|
+
if (!m || !DISPATCH_MODES.has(m[1])) throw new ProductionError("INVALID_DISPATCH", `${request.node}: cannot parse dispatch "${text}"`);
|
|
69
|
+
if (m[2] === vars.SPEC_ENGINE) return m[1];
|
|
70
|
+
}
|
|
71
|
+
throw new ProductionError("INVALID_DISPATCH", `${request.node}: dispatch "${text}" has no entry for SPEC_ENGINE=${vars.SPEC_ENGINE}`);
|
|
72
|
+
}
|
|
73
|
+
|
|
48
74
|
function stamp() {
|
|
49
75
|
return new Date().toISOString();
|
|
50
76
|
}
|
|
@@ -385,7 +411,7 @@ function normalizeConfig(request, checkpoint, answer) {
|
|
|
385
411
|
setVars(checkpoint, values);
|
|
386
412
|
}
|
|
387
413
|
const vars = currentVars(request, checkpoint);
|
|
388
|
-
const resume = vars.
|
|
414
|
+
const resume = vars.FROM_NODE !== "bootstrap";
|
|
389
415
|
if (vars.INTERACTION_MODE === "ask") checkpoint.vars.INTERACTION_MODE = body.interaction.prompt_default;
|
|
390
416
|
if (vars.INTERACTION_MODE === "auto") checkpoint.vars.INTERACTIVE_GATES = "";
|
|
391
417
|
else if (vars.INTERACTION_MODE === "interactive" && vars.INTERACTIVE_GATES === "ask") {
|
|
@@ -410,7 +436,7 @@ function normalizeConfig(request, checkpoint, answer) {
|
|
|
410
436
|
function askRunConfig(request, checkpoint, answer) {
|
|
411
437
|
normalizeConfig(request, checkpoint, answer);
|
|
412
438
|
const vars = currentVars(request, checkpoint);
|
|
413
|
-
const resume = vars.
|
|
439
|
+
const resume = vars.FROM_NODE !== "bootstrap";
|
|
414
440
|
if (configNeedsAnswer(currentVars(request, checkpoint), resume)) {
|
|
415
441
|
const body = request.node_definition.actions.map(actionBody).find((value) => value?.interaction && value?.reuse);
|
|
416
442
|
return waitingResult(request, checkpoint, "waiting_external", {
|
|
@@ -483,10 +509,13 @@ function finishImageProbe(request, checkpoint, answer) {
|
|
|
483
509
|
function runBootstrapAction(request, checkpoint, action, answer) {
|
|
484
510
|
const name = actionName(action);
|
|
485
511
|
const body = actionBody(action);
|
|
512
|
+
if (!BOOTSTRAP_ACTIONS.has(name)) {
|
|
513
|
+
throw new ProductionError("UNSUPPORTED_PRODUCTION_ACTION", `bootstrap action ${name} has no deterministic implementation`);
|
|
514
|
+
}
|
|
486
515
|
const vars = currentVars(request, checkpoint);
|
|
487
516
|
activeVars = vars;
|
|
488
517
|
if (name === "plan_resume") {
|
|
489
|
-
if (
|
|
518
|
+
if (vars.FROM_NODE === "bootstrap") return { skipped: true };
|
|
490
519
|
const args = ["--workflow", request.vars.WORKFLOW, "--ledger", request.paths.ledger,
|
|
491
520
|
"--from-node", vars.FROM_NODE, "--engine", vars.SPEC_ENGINE, "--engine-given", String(vars.SPEC_ENGINE_GIVEN === true)];
|
|
492
521
|
if (vars.RESUME_BASE_PROFILE) args.push("--base-profile", vars.RESUME_BASE_PROFILE);
|
|
@@ -620,6 +649,9 @@ function runWorkspace(request, checkpoint) {
|
|
|
620
649
|
const action = actions[checkpoint.cursor];
|
|
621
650
|
const name = actionName(action);
|
|
622
651
|
const body = actionBody(action);
|
|
652
|
+
if (!WORKSPACE_ACTIONS.has(name)) {
|
|
653
|
+
throw new ProductionError("UNSUPPORTED_PRODUCTION_ACTION", `workspace action ${name} has no deterministic implementation`);
|
|
654
|
+
}
|
|
623
655
|
const vars = currentVars(request, checkpoint);
|
|
624
656
|
activeVars = vars;
|
|
625
657
|
let output;
|
|
@@ -673,7 +705,7 @@ function runSkill(request, checkpoint, outcome) {
|
|
|
673
705
|
for (const action of request.node_definition.after_run || []) {
|
|
674
706
|
const name = actionName(action);
|
|
675
707
|
const body = actionBody(action);
|
|
676
|
-
if (name
|
|
708
|
+
if (!SKILL_AFTER_RUN_ACTIONS.has(name)) throw new ProductionError("UNSUPPORTED_PRODUCTION_ACTION", `after_run ${name} is not implemented`);
|
|
677
709
|
const record = runLifecycleScript(checkpoint, body, ["--work", currentVars(request, checkpoint).WORK, "--show", "--json", "--engine", currentVars(request, checkpoint).SPEC_ENGINE], { allow: [0, 1] });
|
|
678
710
|
if (record.exit_code === 0 && record.json?.run_dir) {
|
|
679
711
|
setVars(checkpoint, { RUN_DIR: record.json.run_dir, SPEC_DIR: record.json.spec_dir });
|
|
@@ -695,14 +727,37 @@ function runSkill(request, checkpoint, outcome) {
|
|
|
695
727
|
const body = actionBody(action);
|
|
696
728
|
const live = currentVars(request, checkpoint);
|
|
697
729
|
activeVars = live;
|
|
730
|
+
if (!SKILL_BEFORE_RUN_ACTIONS.has(name)) {
|
|
731
|
+
throw new ProductionError("UNSUPPORTED_PRODUCTION_ACTION", `before_run ${name} is not implemented`);
|
|
732
|
+
}
|
|
733
|
+
// A `when` guard that is false skips the action (e.g. incremental_scope only runs for PROFILE=incremental);
|
|
734
|
+
// the skip is recorded and the cursor moves on, so a resumed attempt does not re-evaluate it.
|
|
735
|
+
if (body && typeof body === "object" && body.when !== undefined && !condition(body.when, live)) {
|
|
736
|
+
checkpoint.history.push({ action: `before_run:${name}`, index: checkpoint.before_run_cursor, output: { skipped: true, when: body.when } });
|
|
737
|
+
checkpoint.before_run_cursor++;
|
|
738
|
+
saveCheckpoint(request, checkpoint);
|
|
739
|
+
continue;
|
|
740
|
+
}
|
|
698
741
|
let record;
|
|
699
742
|
if (name === "clear_gate_checkpoint" || name === "mark_module_docs_start") {
|
|
700
743
|
const args = String(body.args).split(/\s+/).filter(Boolean).map((arg) => expand(arg, live));
|
|
701
744
|
record = runLifecycleScript(checkpoint, body, args);
|
|
745
|
+
} else if (name === "incremental_scope") {
|
|
746
|
+
// exit≠0 = scope.json missing / empty (ui.batch never confirmed a scope): a business failure of this node,
|
|
747
|
+
// never a range the executor invents (workflow.yaml enrich.spec_gen before_run.incremental_scope).
|
|
748
|
+
const args = String(body.args).split(/\s+/).filter(Boolean).map((arg) => expand(arg, live));
|
|
749
|
+
record = runLifecycleScript(checkpoint, body, args);
|
|
750
|
+
const scopeId = record.json?.scope_id;
|
|
751
|
+
if (typeof scopeId !== "string" || !scopeId) {
|
|
752
|
+
throw new ProductionError("PRODUCTION_SCRIPT_FAILED", "incremental scope not confirmed: progress_identity.mjs scope-id printed no scope_id");
|
|
753
|
+
}
|
|
754
|
+
const scopeIndex = args.indexOf("--scope");
|
|
755
|
+
setVars(checkpoint, { SCOPE_ID: scopeId, ...(scopeIndex >= 0 && args[scopeIndex + 1] ? { SCOPE_JSON: args[scopeIndex + 1] } : {}) });
|
|
702
756
|
} else if (name === "resolve_run_dir") {
|
|
703
757
|
const args = ["--work", live.WORK, "--engine", live.SPEC_ENGINE];
|
|
704
758
|
if (live.RUN_DIR_GIVEN === true && live.RUN_DIR) args.push("--run-dir", live.RUN_DIR);
|
|
705
759
|
if ((request.node_state.generation || 0) > 0 || live.REUSE_ALL === "none") args.push("--fresh");
|
|
760
|
+
if (live.PROFILE === "incremental" && live.SCOPE_ID) args.push("--scope-id", String(live.SCOPE_ID));
|
|
706
761
|
record = runLifecycleScript(checkpoint, body, args);
|
|
707
762
|
if (record.json?.run_dir) setVars(checkpoint, { RUN_DIR: record.json.run_dir, SPEC_DIR: record.json.spec_dir, RUN_MODE: record.json.mode });
|
|
708
763
|
} else if (name === "archive_stale_campaign") {
|
|
@@ -727,7 +782,7 @@ function runSkill(request, checkpoint, outcome) {
|
|
|
727
782
|
kind: "skill",
|
|
728
783
|
skill,
|
|
729
784
|
skill_path: path.join(SKILLS_ROOT, skill),
|
|
730
|
-
dispatch:
|
|
785
|
+
dispatch: resolveDispatch(request, live),
|
|
731
786
|
invoke: expand(request.invoke || "", live),
|
|
732
787
|
vars: live,
|
|
733
788
|
paths: request.paths,
|
|
@@ -17,6 +17,42 @@ const TERMINAL = new Set(["done", "reused", "skipped", "failed"]);
|
|
|
17
17
|
const ACTIVE_ATTEMPT = new Set(["running", "waiting_external", "waiting_human"]);
|
|
18
18
|
const UNSUPPORTED_LIFECYCLE = ["precondition", "before_run", "after_run", "hook", "hooks", "actions"];
|
|
19
19
|
const STDERR_LIMIT = 4096;
|
|
20
|
+
const SKILL_DIR = path.resolve(path.dirname(fileURLToPath(import.meta.url)), "..");
|
|
21
|
+
const DEFAULT_SKILLS_ROOT = path.resolve(SKILL_DIR, "..");
|
|
22
|
+
const INTEGRITY_DIRS = ["scripts"];
|
|
23
|
+
const INTEGRITY_EXTENSIONS = new Set([".mjs", ".js", ".cjs", ".py"]);
|
|
24
|
+
// Only a runner interruption (the previous process died mid-node) is an operational state that continue clears on
|
|
25
|
+
// its own. Every other blocked code needs the user's explicit go-ahead (continue --confirmed-by user): the host cannot
|
|
26
|
+
// reliably tell a skill defect from a crash or a business failure, and an automatic retry is exactly what let a host
|
|
27
|
+
// "fix" a blocked run by patching the skill. That includes EXECUTOR_EARLY_STOP / EXECUTOR_EXIT, which also carry the
|
|
28
|
+
// production executor's own UNSUPPORTED_* rejections.
|
|
29
|
+
const AUTO_RESUMABLE_BLOCKED = new Set(["RUNNER_INTERRUPTED"]);
|
|
30
|
+
// Codes that can only come from the installed skill itself: a yaml/code mismatch or changed skill files.
|
|
31
|
+
const SKILL_DEFECT_CODES = new Set([
|
|
32
|
+
"SKILL_FILES_CHANGED", "WORKFLOW_CHANGED", "INVALID_WORKFLOW", "INVALID_SKILL", "INVALID_DISPATCH",
|
|
33
|
+
"UNSUPPORTED_SUCCESS_RULE", "UNSUPPORTED_NODE_ACTION", "UNSUPPORTED_FAIL_MATRIX", "UNSUPPORTED_PRODUCTION_ACTION",
|
|
34
|
+
"UNSUPPORTED_PRODUCTION_KIND", "INVALID_PRODUCTION_ACTION", "INVALID_PRODUCTION_GATE",
|
|
35
|
+
]);
|
|
36
|
+
const SKILL_DEFECT_PATTERN = new RegExp(`\\b(${[...SKILL_DEFECT_CODES].join("|")})\\b`);
|
|
37
|
+
// A node that failed for real (retries spent / completion evidence missing): a migration result, not a defect.
|
|
38
|
+
const BUSINESS_BLOCKED_CODES = new Set(["FINALIZE_FAILED", "DAG_INCOMPLETE", "INVALID_COMPLETION_EVIDENCE", "RESUME_PROBE_INCOMPLETE"]);
|
|
39
|
+
const NEVER_MODIFY = "Never modify, patch or replace any file under SKILLS_ROOT (runner, executor, workflow.yaml, leaf "
|
|
40
|
+
+ "scripts) and never work around the check.";
|
|
41
|
+
const CONFIRMED_RESUME = "Resume only after the user decides: once they say to retry, run "
|
|
42
|
+
+ "`dag_runner.mjs continue --state <state> --confirmed-by user`.";
|
|
43
|
+
const BLOCKED_HOST_INSTRUCTIONS = {
|
|
44
|
+
interrupted: "The previous runner process stopped while a node was running. This is not a defect: run "
|
|
45
|
+
+ "`dag_runner.mjs continue --state <state>` to start a new attempt (no user confirmation needed).",
|
|
46
|
+
skill_defect: "The migration skill hit a defect it cannot handle (yaml/code mismatch or changed skill files). Report "
|
|
47
|
+
+ `error.code, error.message and the node to the user verbatim and stop. ${NEVER_MODIFY} ${CONFIRMED_RESUME} If they `
|
|
48
|
+
+ "reinstalled or upgraded the skill, start a new DAG control directory with `run --resume-from <node>` instead.",
|
|
49
|
+
business_failure: "A node failed after its retries, or the run's completion evidence is incomplete. This is a "
|
|
50
|
+
+ "migration result, not something to fix in the skill. Report error.code, error.message and the node to the user "
|
|
51
|
+
+ `verbatim and stop. ${NEVER_MODIFY} ${CONFIRMED_RESUME}`,
|
|
52
|
+
executor_error: "A node's executor or host step did not produce a valid result (crash, timeout, missing or malformed "
|
|
53
|
+
+ "result file). First check your own last command (e.g. a wrong --result-file path); then report error.code, "
|
|
54
|
+
+ `error.message and the node to the user verbatim and stop. ${NEVER_MODIFY} ${CONFIRMED_RESUME}`,
|
|
55
|
+
};
|
|
20
56
|
|
|
21
57
|
class RunnerError extends Error {
|
|
22
58
|
constructor(code, message, exitCode = 2, cause) {
|
|
@@ -69,6 +105,100 @@ function workflowDigest(filePath) {
|
|
|
69
105
|
return createHash("sha256").update(fs.readFileSync(filePath)).digest("hex");
|
|
70
106
|
}
|
|
71
107
|
|
|
108
|
+
/**
|
|
109
|
+
* sha256 of every code file under this skill's scripts/ (the runner, the executor and every script a node runs).
|
|
110
|
+
* Recorded when a run starts and re-checked by every command that advances it, so an edited runner / executor /
|
|
111
|
+
* lifecycle script blocks the run instead of silently producing a result from changed code.
|
|
112
|
+
*/
|
|
113
|
+
export function skillIntegrity(skillDir = SKILL_DIR) {
|
|
114
|
+
const files = {};
|
|
115
|
+
const walk = (dir) => {
|
|
116
|
+
let entries;
|
|
117
|
+
try {
|
|
118
|
+
entries = fs.readdirSync(dir, { withFileTypes: true });
|
|
119
|
+
} catch {
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
for (const entry of entries.sort((a, b) => a.name.localeCompare(b.name))) {
|
|
123
|
+
if (entry.name === "node_modules" || entry.name === "__pycache__" || entry.name.startsWith(".")) continue;
|
|
124
|
+
const full = path.join(dir, entry.name);
|
|
125
|
+
if (entry.isDirectory()) walk(full);
|
|
126
|
+
else if (entry.isFile() && INTEGRITY_EXTENSIONS.has(path.extname(entry.name))) {
|
|
127
|
+
files[path.relative(skillDir, full).split(path.sep).join("/")] = workflowDigest(full);
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
};
|
|
131
|
+
for (const dir of INTEGRITY_DIRS) walk(path.join(skillDir, dir));
|
|
132
|
+
return { root: skillDir, files };
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
function integrityDiff(recorded, current) {
|
|
136
|
+
const changed = [];
|
|
137
|
+
const removed = [];
|
|
138
|
+
const added = [];
|
|
139
|
+
for (const [file, digest] of Object.entries(recorded.files || {})) {
|
|
140
|
+
if (!(file in current.files)) removed.push(file);
|
|
141
|
+
else if (current.files[file] !== digest) changed.push(file);
|
|
142
|
+
}
|
|
143
|
+
for (const file of Object.keys(current.files)) if (!(file in (recorded.files || {}))) added.push(file);
|
|
144
|
+
return { changed, removed, added };
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
function assertSkillIntact(state) {
|
|
148
|
+
if (!state.integrity || typeof state.integrity !== "object") return;
|
|
149
|
+
const recordedRoot = state.integrity.root ? path.resolve(state.integrity.root) : SKILL_DIR;
|
|
150
|
+
const sameRoot = process.platform === "win32" ? recordedRoot.toLowerCase() === SKILL_DIR.toLowerCase() : recordedRoot === SKILL_DIR;
|
|
151
|
+
if (!sameRoot) {
|
|
152
|
+
throw new RunnerError(
|
|
153
|
+
"SKILL_FILES_CHANGED",
|
|
154
|
+
`Run ${state.run_id} started with the skill at ${recordedRoot}, but this runner is ${SKILL_DIR}. A run must keep `
|
|
155
|
+
+ "using the runner it started with; after an intended reinstall / upgrade start a new DAG control directory with "
|
|
156
|
+
+ "run --resume-from.",
|
|
157
|
+
3,
|
|
158
|
+
);
|
|
159
|
+
}
|
|
160
|
+
const diff = integrityDiff(state.integrity, skillIntegrity(SKILL_DIR));
|
|
161
|
+
if (!diff.changed.length && !diff.removed.length && !diff.added.length) return;
|
|
162
|
+
const parts = [
|
|
163
|
+
diff.changed.length ? `changed: ${diff.changed.join(", ")}` : "",
|
|
164
|
+
diff.removed.length ? `removed: ${diff.removed.join(", ")}` : "",
|
|
165
|
+
diff.added.length ? `added: ${diff.added.join(", ")}` : "",
|
|
166
|
+
].filter(Boolean);
|
|
167
|
+
throw new RunnerError(
|
|
168
|
+
"SKILL_FILES_CHANGED",
|
|
169
|
+
`Skill scripts differ from the ones run ${state.run_id} started with (${parts.join("; ")}). `
|
|
170
|
+
+ "Editing the migration skill during a run is forbidden; restore the original files, or after an intended "
|
|
171
|
+
+ "reinstall / upgrade start a new DAG control directory with run --resume-from.",
|
|
172
|
+
3,
|
|
173
|
+
);
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
export function blockedCategory(error) {
|
|
177
|
+
const code = error?.code || "";
|
|
178
|
+
if (AUTO_RESUMABLE_BLOCKED.has(code)) return "interrupted";
|
|
179
|
+
if (SKILL_DEFECT_CODES.has(code) || SKILL_DEFECT_PATTERN.test(String(error?.message || ""))) return "skill_defect";
|
|
180
|
+
if (BUSINESS_BLOCKED_CODES.has(code)) return "business_failure";
|
|
181
|
+
return "executor_error";
|
|
182
|
+
}
|
|
183
|
+
|
|
184
|
+
/**
|
|
185
|
+
* Host guidance for a blocked result. `error` is what the CLI reports; when it is BLOCKED_NEEDS_USER_CONFIRMATION,
|
|
186
|
+
* `blockedOn` is the error the run is actually blocked on, and it decides the category.
|
|
187
|
+
*/
|
|
188
|
+
export function blockedGuidance(error, blockedOn = error) {
|
|
189
|
+
const category = blockedCategory(blockedOn);
|
|
190
|
+
return {
|
|
191
|
+
category,
|
|
192
|
+
skill_defect: category === "skill_defect",
|
|
193
|
+
requires_user_confirmation: category !== "interrupted",
|
|
194
|
+
code: error?.code || "",
|
|
195
|
+
blocked_on: blockedOn?.code || "",
|
|
196
|
+
message: blockedOn?.message || error?.message || "",
|
|
197
|
+
node: blockedOn?.node || error?.node || null,
|
|
198
|
+
host_instruction: BLOCKED_HOST_INSTRUCTIONS[category],
|
|
199
|
+
};
|
|
200
|
+
}
|
|
201
|
+
|
|
72
202
|
function readWorkflow(filePath) {
|
|
73
203
|
let document;
|
|
74
204
|
try {
|
|
@@ -116,6 +246,12 @@ function workflowVars(document, explicit, profile) {
|
|
|
116
246
|
: definition;
|
|
117
247
|
}
|
|
118
248
|
Object.assign(values, explicit);
|
|
249
|
+
// `${SKILLS_ROOT}` (workflow.yaml skill_root_var) is the directory this runner was installed into; without it
|
|
250
|
+
// every `${SKILLS_ROOT}/…` script path renders as `/…` and resolves against the drive root.
|
|
251
|
+
const rootVar = typeof document.skill_root_var === "string" ? document.skill_root_var : "";
|
|
252
|
+
if (rootVar && (values[rootVar] === undefined || values[rootVar] === null || values[rootVar] === "")) {
|
|
253
|
+
values[rootVar] = DEFAULT_SKILLS_ROOT.split(path.sep).join("/");
|
|
254
|
+
}
|
|
119
255
|
values.RUN_DIR_GIVEN = Object.prototype.hasOwnProperty.call(explicit, "RUN_DIR");
|
|
120
256
|
if (Object.prototype.hasOwnProperty.call(explicit, "SPEC_ENGINE")) values.SPEC_ENGINE_GIVEN = true;
|
|
121
257
|
if (Object.prototype.hasOwnProperty.call(explicit, "SPECS_JSON")) {
|
|
@@ -444,8 +580,14 @@ function loadContext(rawOptions) {
|
|
|
444
580
|
}
|
|
445
581
|
const document = readWorkflow(workflowPath);
|
|
446
582
|
if (workflowDigest(workflowPath) !== state.workflow.sha256) {
|
|
447
|
-
throw new RunnerError(
|
|
583
|
+
throw new RunnerError(
|
|
584
|
+
"WORKFLOW_CHANGED",
|
|
585
|
+
`Workflow sha256 does not match run ${state.run_id}: workflow.yaml was edited during the run, which is forbidden; `
|
|
586
|
+
+ "restore it, or after an intended reinstall / upgrade start a new DAG control directory with run --resume-from.",
|
|
587
|
+
3,
|
|
588
|
+
);
|
|
448
589
|
}
|
|
590
|
+
assertSkillIntact(state);
|
|
449
591
|
const production = productionWorkflow(document);
|
|
450
592
|
const context = {
|
|
451
593
|
statePath,
|
|
@@ -1295,7 +1437,7 @@ export function startRun(rawOptions) {
|
|
|
1295
1437
|
}
|
|
1296
1438
|
profile = resumePlan.base_profile;
|
|
1297
1439
|
}
|
|
1298
|
-
if (
|
|
1440
|
+
if (!document.profiles?.[profile]) {
|
|
1299
1441
|
throw new RunnerError("INVALID_PROFILE", `Unknown concrete workflow profile: ${profile}`);
|
|
1300
1442
|
}
|
|
1301
1443
|
const graph = buildGraph(document, { profile });
|
|
@@ -1330,6 +1472,7 @@ export function startRun(rawOptions) {
|
|
|
1330
1472
|
schema: SCHEMA,
|
|
1331
1473
|
run_id: runId,
|
|
1332
1474
|
workflow: { path: workflowPath, sha256: workflowDigest(workflowPath) },
|
|
1475
|
+
integrity: skillIntegrity(),
|
|
1333
1476
|
profile,
|
|
1334
1477
|
vars: allVars,
|
|
1335
1478
|
status: "running",
|
|
@@ -1408,12 +1551,42 @@ function probesForResume(document) {
|
|
|
1408
1551
|
return probeEntries(document);
|
|
1409
1552
|
}
|
|
1410
1553
|
|
|
1554
|
+
function blockedOnError(blockedOn, error) {
|
|
1555
|
+
error.blockedOn = { code: blockedOn.code || "", message: blockedOn.message || "", node: blockedOn.node || null };
|
|
1556
|
+
return error;
|
|
1557
|
+
}
|
|
1558
|
+
|
|
1411
1559
|
export function advance(options) {
|
|
1412
1560
|
const normalized = normalizeStateOptions(options);
|
|
1413
1561
|
const statePath = absolute(normalized.state || normalized.statePath || "");
|
|
1414
1562
|
return withLock(statePath, async () => {
|
|
1415
1563
|
const context = loadContext(normalized);
|
|
1564
|
+
// A run that is already blocked on a skill defect resumes only with the user's explicit go-ahead.
|
|
1565
|
+
const blockedBefore = context.state.status === "blocked" ? (context.state.error || {}) : null;
|
|
1566
|
+
if (blockedBefore && !AUTO_RESUMABLE_BLOCKED.has(blockedBefore.code)) {
|
|
1567
|
+
if (normalized.confirmedBy !== "user") {
|
|
1568
|
+
throw blockedOnError(blockedBefore, new RunnerError(
|
|
1569
|
+
"BLOCKED_NEEDS_USER_CONFIRMATION",
|
|
1570
|
+
`Run is blocked on ${blockedBefore.code || "an error"}${blockedBefore.node ? ` at ${blockedBefore.node}` : ""}: `
|
|
1571
|
+
+ `${blockedBefore.message || ""}. Report it to the user and wait; resume only with continue --confirmed-by user `
|
|
1572
|
+
+ "after the user decides to retry.",
|
|
1573
|
+
3,
|
|
1574
|
+
));
|
|
1575
|
+
}
|
|
1576
|
+
context.state.blocked_acks = [...(context.state.blocked_acks || []), {
|
|
1577
|
+
code: blockedBefore.code || null,
|
|
1578
|
+
node: blockedBefore.node || null,
|
|
1579
|
+
message: blockedBefore.message || "",
|
|
1580
|
+
confirmed_by: "user",
|
|
1581
|
+
confirmed_at: stamp(),
|
|
1582
|
+
}];
|
|
1583
|
+
}
|
|
1416
1584
|
recoverContext(context);
|
|
1585
|
+
// recoverContext may block the run in this very call (a result file left by a runner that died before processing
|
|
1586
|
+
// it turns out invalid / stale): that needs the user exactly like a run that was already blocked.
|
|
1587
|
+
if (!blockedBefore && context.state.status === "blocked" && !AUTO_RESUMABLE_BLOCKED.has(context.state.error?.code)) {
|
|
1588
|
+
return context.state;
|
|
1589
|
+
}
|
|
1417
1590
|
context.executorCommand = normalized.executorCommand !== undefined ? normalized.executorCommand : context.state.executor.command;
|
|
1418
1591
|
context.executorTimeoutMs = normalized.executorTimeoutMs !== undefined ? Number(normalized.executorTimeoutMs) : context.state.executor.timeout_ms;
|
|
1419
1592
|
if (!Number.isInteger(context.executorTimeoutMs) || context.executorTimeoutMs < 0) {
|
|
@@ -1702,6 +1875,7 @@ function summary(state) {
|
|
|
1702
1875
|
current_attempt_id: node.current_attempt_id,
|
|
1703
1876
|
}])),
|
|
1704
1877
|
ledger_commit: state.ledger_commit,
|
|
1878
|
+
...(state.blocked_acks?.length ? { blocked_acks: state.blocked_acks } : {}),
|
|
1705
1879
|
updated_at: state.updated_at,
|
|
1706
1880
|
};
|
|
1707
1881
|
}
|
|
@@ -1748,7 +1922,8 @@ async function main(argv) {
|
|
|
1748
1922
|
const presentation = command === "status"
|
|
1749
1923
|
? null
|
|
1750
1924
|
: presentationForTransition(previousState, state, readWorkflow(state.workflow.path));
|
|
1751
|
-
|
|
1925
|
+
const blocked = state.status === "blocked" ? { blocked: blockedGuidance(state.error) } : {};
|
|
1926
|
+
process.stdout.write(`${JSON.stringify({ ...summary(state), ...(presentation ? { presentation } : {}), ...blocked, exit_code: code })}\n`);
|
|
1752
1927
|
return code;
|
|
1753
1928
|
}
|
|
1754
1929
|
|
|
@@ -1759,7 +1934,12 @@ if (isDirect) {
|
|
|
1759
1934
|
process.exitCode = code;
|
|
1760
1935
|
} catch (error) {
|
|
1761
1936
|
const code = Number.isInteger(error?.exitCode) ? error.exitCode : 2;
|
|
1762
|
-
const
|
|
1937
|
+
const errorBody = { code: error?.code || "INVALID", message: String(error?.message || error) };
|
|
1938
|
+
const payload = {
|
|
1939
|
+
status: code === 3 ? "blocked" : "invalid",
|
|
1940
|
+
error: errorBody,
|
|
1941
|
+
...(code === 3 ? { blocked: blockedGuidance(errorBody, error?.blockedOn || errorBody) } : {}),
|
|
1942
|
+
};
|
|
1763
1943
|
process.stdout.write(`${JSON.stringify({ ...payload, exit_code: code })}\n`);
|
|
1764
1944
|
process.stderr.write(String(error?.message || error) + "\n");
|
|
1765
1945
|
process.exitCode = code;
|
|
@@ -842,7 +842,7 @@ export function resolveAppModule(candidates, requested, { sourceKind = "" } = {}
|
|
|
842
842
|
};
|
|
843
843
|
}
|
|
844
844
|
|
|
845
|
-
export const PROFILES = ["full", "ui-only", "incremental"
|
|
845
|
+
export const PROFILES = ["full", "ui-only", "incremental"];
|
|
846
846
|
|
|
847
847
|
/**
|
|
848
848
|
* profile=incremental preconditions (scenario 3: a few pages into an existing HarmonyOS project), checked here so
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/**
|
|
3
|
-
* Reads and writes ${LEDGER} (stage-ledger.jsonl). Append-only and kept across runs:
|
|
3
|
+
* Reads and writes ${LEDGER} (stage-ledger.jsonl). Append-only and kept across runs: resuming (FROM_NODE) relies on it to know the original run's
|
|
4
4
|
* profile and each node's terminal state (resume_plan.mjs), so every run records a run_start line at the start, and every node records a line on reaching its terminal state.
|
|
5
5
|
*
|
|
6
6
|
* node ledger.mjs --ledger <LEDGER> --start --profile <p> [--from-node <id>] [--engine <spec-generate|page-specgen>]
|
|
7
|
-
* Appends {event:"run_start", profile, from_node, resume, spec_engine?, at}.
|
|
7
|
+
* Appends {event:"run_start", profile, from_node, resume, spec_engine?, at}. When resuming pass the base_profile computed by resume_plan,
|
|
8
8
|
* together with --from-node (resume is expressed by from_node != bootstrap). --engine records the spec engine of the original run
|
|
9
9
|
* (an unknown value -> exit 2); resume_plan inherits it, and a resume may not switch it.
|
|
10
10
|
* node ledger.mjs --ledger <LEDGER> --node <id> --begin
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
/**
|
|
3
|
-
* Reuse decisions for
|
|
3
|
+
* Reuse decisions for resuming from FROM_NODE (FROM_NODE != bootstrap). Resume used to be a standalone profile (all lanes, no force_skip),
|
|
4
4
|
* forcing reuse for every ancestor of FROM_NODE and hard_stopping on an incomplete probe:
|
|
5
5
|
* - resuming after a ui.batch soft failure under full -> a failure the original run tolerated is treated as a missing artifact -> hard_stop;
|
|
6
6
|
* - resuming after a ui-only run -> utg_static was skipped by ui-only -> hard_stop, and spec_gen / logic get pulled back in;
|
|
@@ -110,9 +110,9 @@ const truthy = (v) => ["true", "1", "yes", "on"].includes(String(v ?? "").trim()
|
|
|
110
110
|
|
|
111
111
|
export function planResume(doc, records, { fromNode, baseProfile = "", engine = "", engineGiven = false }) {
|
|
112
112
|
const ids = new Set((doc.nodes || []).map((n) => n.id));
|
|
113
|
-
if (!fromNode || fromNode === "bootstrap") throw new PlanError("
|
|
113
|
+
if (!fromNode || fromNode === "bootstrap") throw new PlanError("resume requires from_node=<node id> (not bootstrap)", 2);
|
|
114
114
|
if (!ids.has(fromNode)) throw new PlanError(`FROM_NODE \`${fromNode}\` is not a workflow node id`, 2);
|
|
115
|
-
const concrete = Object.keys(doc.profiles || {})
|
|
115
|
+
const concrete = Object.keys(doc.profiles || {});
|
|
116
116
|
if (baseProfile && !concrete.includes(baseProfile)) {
|
|
117
117
|
throw new PlanError(`resume_base_profile must be one of ${concrete.join(" / ")}, got ${baseProfile}`, 2);
|
|
118
118
|
}
|