@buaa_smat/hometrans 26.0.3 → 26.0.4
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 +1 -1
- package/agents/code-reviewer.md +91 -21
- package/env-requirements.json +1 -1
- package/i18n/agents/code-reviewer.md +93 -21
- package/i18n/skills/a2h-app-migrate/SKILL.md +19 -11
- package/i18n/skills/a2h-app-migrate/references/feature-scope.md +121 -0
- package/i18n/skills/a2h-app-migrate/references/stage-map.md +2 -2
- package/i18n/skills/a2h-app-migrate/references/workflow.yaml +320 -73
- package/i18n/skills/a2h-app-migrate/scripts/check_spec_gen_done.mjs +78 -5
- package/i18n/skills/a2h-app-migrate/scripts/env_preflight.mjs +79 -11
- package/i18n/skills/a2h-app-migrate/scripts/human_review_gate.mjs +75 -4
- package/i18n/skills/a2h-app-migrate/test/test_android_index.mjs +12 -0
- package/i18n/skills/a2h-app-migrate/test/test_env_requirements.mjs +25 -10
- package/i18n/skills/a2h-app-migrate/test/test_finalize.mjs +35 -7
- package/i18n/skills/a2h-app-migrate/test/test_resume_plan.mjs +52 -0
- package/i18n/skills/a2h-app-migrate/test/test_resume_summary.mjs +26 -0
- package/i18n/skills/a2h-app-migrate/test/test_reuse_static_utg.mjs +36 -0
- package/i18n/skills/a2h-app-migrate/test/test_run_dir.mjs +71 -7
- package/i18n/skills/a2h-app-migrate/test/test_spec_gen_done.mjs +117 -0
- package/i18n/skills/a2h-app-migrate/test/test_spec_gen_gate.mjs +7 -3
- package/i18n/skills/a2h-app-migrate/test/test_utg_static_done.mjs +38 -2
- package/i18n/skills/a2h-arch-generate/SKILL.md +20 -17
- package/i18n/skills/a2h-arch-generate/references/database-schema-recovery.md +2 -2
- package/i18n/skills/a2h-arch-generate/references/harmony-project-inspection.md +8 -8
- package/i18n/skills/a2h-arch-generate/references/homegraph-workflow.md +25 -14
- package/i18n/skills/a2h-arch-generate/references/source-baseline.md +4 -4
- package/i18n/skills/a2h-arch-generate/scripts/tests/run_tests.mjs +3 -3
- package/i18n/skills/a2h-arkts-logic-coder/SKILL.md +304 -0
- package/i18n/skills/a2h-arkts-logic-coder/references/ISSUES.md +2 -1
- package/i18n/skills/a2h-arkts-logic-coder/references/code-generation.md +59 -2
- package/i18n/skills/a2h-arkts-logic-coder/references/spec-design.md +52 -11
- package/i18n/skills/a2h-arkts-logic-coder/scripts/state_doc.mjs +328 -38
- package/i18n/skills/a2h-arkts-logic-coder/test/test_state_doc.mjs +245 -0
- package/i18n/skills/a2h-batch-ui-align/SKILL.md +70 -21
- package/i18n/skills/a2h-batch-ui-align/references/cards/alignment.md +5 -1
- package/i18n/skills/a2h-batch-ui-align/references/cards/geometry.md +5 -0
- package/i18n/skills/a2h-batch-ui-align/references/cards/interaction.md +2 -1
- package/i18n/skills/a2h-batch-ui-align/references/cards/resources.md +6 -4
- package/i18n/skills/a2h-batch-ui-align/references/cards/widgets.md +5 -0
- package/i18n/skills/a2h-batch-ui-align/references/cards/window.md +2 -1
- package/i18n/skills/a2h-batch-ui-align/references/checker-rules.md +236 -11
- package/i18n/skills/a2h-batch-ui-align/references/conversion-procedure.md +8 -5
- package/i18n/skills/a2h-batch-ui-align/references/incremental-scope.md +28 -9
- package/i18n/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-atomic-component-mapping-reference.md +7 -4
- package/i18n/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-layout-mapping-reference.md +28 -1
- package/i18n/skills/a2h-batch-ui-align/references/state-mgmt/_decorator-quickref.md +31 -0
- package/i18n/skills/a2h-batch-ui-align/references/step3-capture.md +22 -6
- package/i18n/skills/a2h-batch-ui-align/references/step4-prepare.md +3 -0
- package/i18n/skills/a2h-batch-ui-align/references/step5-convert.md +26 -4
- package/i18n/skills/a2h-batch-ui-align/scripts/branch_coverage.mjs +155 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/build_conversion_set.mjs +386 -16
- package/i18n/skills/a2h-batch-ui-align/scripts/export_ui_info.mjs +19 -1
- package/i18n/skills/a2h-batch-ui-align/scripts/group_pack.mjs +134 -11
- package/i18n/skills/a2h-batch-ui-align/scripts/icon_coverage.mjs +147 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/measure_pack.ts +231 -5
- package/i18n/skills/a2h-batch-ui-align/scripts/phase5_check.mjs +82 -8
- package/i18n/skills/a2h-batch-ui-align/scripts/shell_contract.mjs +21 -7
- package/i18n/skills/a2h-batch-ui-align/scripts/state_doc.mjs +9 -4
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/main.ts +48 -5
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/a11y.ts +3 -17
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/attr_chain.ts +1 -19
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/dialog_backboard.ts +91 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/event_default_click.ts +179 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/hit_test.ts +339 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/image_source.ts +84 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/input_traps.ts +249 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/layout_placement.ts +234 -5
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/lottie_host.ts +145 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/media_tint.ts +45 -11
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/overlay_binds.ts +56 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/overlay_string.ts +96 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/padding_in_size.ts +60 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/percent_height_in_scroll.ts +3 -2
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/relative_container_height.ts +102 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/root_weight.ts +54 -4
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/runtime_traps.ts +440 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/scroll_align.ts +75 -23
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/swiper_index.ts +65 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/theme_color.ts +63 -2
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/waterflow_sections.ts +231 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/wide_constant_width.ts +4 -4
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_input_runtime.test.mjs +514 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_layout_placement.test.mjs +224 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_overlay_lottie.test.mjs +199 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/branch_coverage.test.mjs +116 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/build_conversion_set.test.mjs +133 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/measure_pack.test.mjs +5 -3
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/phase5_check.test.mjs +33 -2
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/skill_doc_contract.test.mjs +12 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/state_doc.test.mjs +8 -0
- package/i18n/skills/a2h-coldstart-smoke-gate/SKILL.md +7 -4
- package/i18n/skills/a2h-dashboard-render/scripts/device_capture.mjs +11 -9
- package/i18n/skills/a2h-module-semantic-docs/SKILL.md +51 -13
- package/i18n/skills/a2h-page-specgen/SKILL.md +123 -20
- package/i18n/skills/a2h-page-specgen/references/behavior-ledger.md +1174 -0
- package/i18n/skills/a2h-page-specgen/references/body-language.md +11 -9
- package/i18n/skills/a2h-page-specgen/references/gates.md +119 -52
- package/i18n/skills/a2h-page-specgen/references/page-inventory.md +69 -22
- package/i18n/skills/a2h-page-specgen/references/scenario-authoring.md +274 -0
- package/i18n/skills/a2h-page-specgen/references/spec-example.md +312 -0
- package/i18n/skills/a2h-page-specgen/references/spec-template.md +113 -110
- package/i18n/skills/a2h-page-specgen/scripts/behavior-audit.mjs +2436 -0
- package/i18n/skills/a2h-page-specgen/scripts/behavior-discovery.mjs +1833 -0
- package/i18n/skills/a2h-page-specgen/scripts/behavior-model.mjs +181 -0
- package/i18n/skills/a2h-page-specgen/scripts/behavior-reconcile.mjs +1205 -0
- package/i18n/skills/a2h-page-specgen/scripts/entry-evidence.mjs +1123 -0
- package/i18n/skills/a2h-page-specgen/scripts/facts-build.mjs +171 -62
- package/i18n/skills/a2h-page-specgen/scripts/footprint.mjs +314 -192
- package/i18n/skills/a2h-page-specgen/scripts/gate.mjs +364 -76
- package/i18n/skills/a2h-page-specgen/scripts/interactions.mjs +216 -8
- package/i18n/skills/a2h-page-specgen/scripts/inventory.mjs +371 -0
- package/i18n/skills/a2h-page-specgen/scripts/lib/contracts.mjs +116 -223
- package/i18n/skills/a2h-page-specgen/scripts/lib/graph-evidence.mjs +235 -0
- package/i18n/skills/a2h-page-specgen/scripts/lib/hg.mjs +521 -13
- package/i18n/skills/a2h-page-specgen/scripts/lib/homegraph-process.mjs +102 -0
- package/i18n/skills/a2h-page-specgen/scripts/lib/homegraph-query.mjs +161 -0
- package/i18n/skills/a2h-page-specgen/scripts/lib/operation-reviews.mjs +913 -0
- package/i18n/skills/a2h-page-specgen/scripts/lib/prose.mjs +12 -8
- package/i18n/skills/a2h-page-specgen/scripts/lib/semantic-detail.mjs +353 -0
- package/i18n/skills/a2h-page-specgen/scripts/lib/source-text.mjs +497 -0
- package/i18n/skills/a2h-page-specgen/scripts/operation-evidence.mjs +1542 -0
- package/i18n/skills/a2h-page-specgen/scripts/prepare.mjs +483 -125
- package/i18n/skills/a2h-page-specgen/scripts/render.mjs +10 -33
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/acceptance.mjs +288 -7
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.json +25 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.prompt.md +373 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.worker.md +300 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.json +47 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.prompt.md +373 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.worker.md +300 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.discovery.json +2694 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.json +726 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.post-review.json +108 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.prompt.md +373 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.review.md +65 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.worker.md +267 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.json +57 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.prompt.md +373 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.worker.md +300 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/branch-checklist.md +32 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/gate-results.json +22 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/manifest.json +111 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/portability.test.mjs +141 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/review.md +22 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/run.mjs +553 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/android-entry-evidence.test.mjs +585 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/android-operation-evidence.test.mjs +755 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/behavior-audit-group.test.mjs +546 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/behavior-audit-post.test.mjs +655 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/behavior-audit-pre.test.mjs +1234 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/behavior-component-gate.test.mjs +520 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/behavior-discovery.test.mjs +1516 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/behavior-finalize.test.mjs +759 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/behavior-fixtures.mjs +630 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/behavior-model.test.mjs +118 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/behavior-reconcile.test.mjs +798 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/behavior-regression.test.mjs +886 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/contracts.test.mjs +134 -163
- package/i18n/skills/a2h-page-specgen/scripts/test/entry-evidence.test.mjs +475 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/facts.test.mjs +40 -1
- package/i18n/skills/a2h-page-specgen/scripts/test/finalize.test.mjs +206 -9
- package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/App.vue +1 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/bundle-conflict-record.json +17 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/bundle-record.json +17 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/manifest.json +3 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/pages/list/index.vue +80 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/pages.json +14 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/source-record.json +15 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/src/components/RefreshPanel.vue +15 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/src/composables/useRefresh.ts +50 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/src/pages/help/index.vue +9 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/src/state/store.ts +4 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/footprint-resolve.test.mjs +459 -188
- package/i18n/skills/a2h-page-specgen/scripts/test/gate-partial.test.mjs +89 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/gate.test.mjs +862 -12
- package/i18n/skills/a2h-page-specgen/scripts/test/graph-evidence.test.mjs +332 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/helpers.mjs +139 -5
- package/i18n/skills/a2h-page-specgen/scripts/test/hg.test.mjs +378 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/homegraph-process-fixture.mjs +130 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/homegraph-query.test.mjs +288 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/integration.test.mjs +69 -2
- package/i18n/skills/a2h-page-specgen/scripts/test/interactions.test.mjs +267 -2
- package/i18n/skills/a2h-page-specgen/scripts/test/inventory.test.mjs +111 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/keys.test.mjs +10 -8
- package/i18n/skills/a2h-page-specgen/scripts/test/operation-reviews.test.mjs +1002 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/plan-build.test.mjs +143 -51
- package/i18n/skills/a2h-page-specgen/scripts/test/prepare-homegraph-reproduction.mjs +365 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/prepare-homegraph.test.mjs +569 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/prepare-pipeline.test.mjs +326 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/prompt-tpl.test.mjs +166 -3
- package/i18n/skills/a2h-page-specgen/scripts/test/prose.test.mjs +13 -5
- package/i18n/skills/a2h-page-specgen/scripts/test/protocol-docs.test.mjs +531 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/recovery-e2e.test.mjs +102 -7
- package/i18n/skills/a2h-page-specgen/scripts/test/recovery.test.mjs +1308 -72
- package/i18n/skills/a2h-page-specgen/scripts/test/render.test.mjs +69 -44
- package/i18n/skills/a2h-page-specgen/scripts/test/review-followup.test.mjs +467 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/semantic-detail.test.mjs +949 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/submit.test.mjs +658 -120
- package/i18n/skills/a2h-page-specgen/scripts/test/uniapp-operation-evidence.test.mjs +639 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/utg-footprint-contract.test.mjs +274 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/waker-process.test.mjs +101 -65
- package/i18n/skills/a2h-resource-convert/SKILL.md +9 -1
- package/i18n/skills/a2h-resource-convert/references/code-vector-icon-rules.md +2 -1
- package/i18n/skills/a2h-resource-convert/references/incremental-page-migration.md +23 -2
- package/i18n/skills/a2h-resource-convert/references/lottie-conversion-rules.md +7 -0
- package/i18n/skills/a2h-resource-convert/references/step4-resource-types.md +2 -0
- package/i18n/skills/a2h-resource-convert/scripts/a2h_resource_convert.ts +67 -3
- package/i18n/skills/a2h-resource-convert/scripts/lottie_hosts.ts +415 -0
- package/i18n/skills/a2h-resource-convert/scripts/tests/lottie_hosts.test.mjs +222 -0
- package/i18n/skills/a2h-spec-design-pipeline/SKILL.md +69 -109
- package/i18n/skills/a2h-spec-design-pipeline/references/coding-loop.md +135 -37
- package/i18n/skills/a2h-spec-design-pipeline/references/homegraph-cli.md +307 -0
- package/i18n/skills/a2h-spec-design-pipeline/references/initialization.md +103 -0
- package/i18n/skills/a2h-spec-design-pipeline/references/merge-queue.md +126 -23
- package/i18n/skills/a2h-spec-design-pipeline/references/post-loop.md +23 -0
- package/i18n/skills/a2h-spec-design-pipeline/references/review-loop.md +71 -0
- package/i18n/skills/a2h-spec-design-pipeline/references/scripts.md +24 -13
- package/i18n/skills/a2h-spec-design-pipeline/references/state-and-resume.md +246 -0
- package/i18n/skills/a2h-spec-design-pipeline/scripts/plan_groups.ts +170 -7
- package/i18n/skills/a2h-spec-design-pipeline/scripts/test_plan_groups.ts +155 -0
- package/i18n/skills/a2h-spec-generate/SKILL.md +2 -2
- package/i18n/skills/a2h-utg-explorer/SKILL.md +9 -3
- package/i18n/skills/a2h-utg-explorer/references/architecture.md +3 -0
- package/i18n/skills/a2h-utg-explorer/scripts/compile_tasks.mjs +74 -84
- package/i18n/skills/a2h-utg-explorer/scripts/hybrid_route_cdp.mjs +376 -0
- package/i18n/skills/a2h-utg-explorer/scripts/recover_d.mjs +288 -21
- package/i18n/skills/a2h-utg-explorer/scripts/seed_recipes.mjs +426 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/diagnostics.test.mjs +252 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/hybrid_route_identity.test.mjs +146 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/interruptions.test.mjs +122 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/launch_bridge.test.mjs +15 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/seed_recipes.test.mjs +261 -0
- package/i18n/skills/a2h-utg-explorer/scripts/utg_explorer/diagnostics.mjs +196 -0
- package/i18n/skills/a2h-utg-explorer/scripts/utg_explorer/hybrid_route.mjs +140 -0
- package/i18n/skills/a2h-utg-explorer/scripts/utg_explorer/semantics.mjs +211 -61
- package/i18n/skills/a2h-utg-explorer/scripts/utg_explorer/state_phase.mjs +47 -0
- package/i18n/skills/a2h-utg-explorer/scripts/utg_explorer/task_runner.mjs +724 -47
- package/i18n/skills/a2h-utg-static/SKILL.md +6 -2
- package/i18n/skills/a2h-utg-static/scripts/assemble.mjs +82 -12
- package/i18n/skills/a2h-utg-static/scripts/click_paths.mjs +116 -5
- package/i18n/skills/a2h-utg-static/scripts/compose_body_text.mjs +3 -3
- package/i18n/skills/a2h-utg-static/scripts/compose_titles.mjs +5 -5
- package/i18n/skills/a2h-utg-static/scripts/compose_widgets.mjs +4 -4
- package/i18n/skills/a2h-utg-static/scripts/data_model.mjs +590 -0
- package/i18n/skills/a2h-utg-static/scripts/data_producers.mjs +431 -0
- package/i18n/skills/a2h-utg-static/scripts/hybrid_scope.mjs +50 -5
- package/i18n/skills/a2h-utg-static/scripts/label_resolve.mjs +49 -4
- package/i18n/skills/a2h-utg-static/scripts/lib/hybrid-provenance.mjs +201 -0
- package/i18n/skills/a2h-utg-static/scripts/lib/uniapp-routes.mjs +195 -0
- package/i18n/skills/a2h-utg-static/scripts/nl_hints.mjs +32 -4
- package/i18n/skills/a2h-utg-static/scripts/tests/test_compose_res_text.mjs +17 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_data_model.mjs +120 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_data_producers.mjs +113 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_hybrid_provenance.mjs +150 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_hybrid_scope.mjs +181 -17
- package/i18n/skills/a2h-utg-static/scripts/tests/test_module_strings.mjs +35 -1
- package/i18n/skills/a2h-utg-static/scripts/tests/test_uniapp_routes.mjs +161 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_uniapp_source.mjs +118 -19
- package/i18n/skills/a2h-utg-static/scripts/tests/test_utg_specgen_boundary.mjs +45 -0
- package/i18n/skills/a2h-utg-static/scripts/uniapp_nav.mjs +113 -70
- package/package.json +3 -6
- package/skills/a2h-app-migrate/SKILL.md +19 -11
- package/skills/a2h-app-migrate/references/feature-scope.md +121 -0
- package/skills/a2h-app-migrate/references/stage-map.md +2 -2
- package/skills/a2h-app-migrate/references/workflow.yaml +307 -74
- package/skills/a2h-app-migrate/scripts/android_index.mjs +35 -8
- package/skills/a2h-app-migrate/scripts/check_module_docs_done.mjs +39 -1
- package/skills/a2h-app-migrate/scripts/check_spec_gen_done.mjs +78 -5
- package/skills/a2h-app-migrate/scripts/check_spec_pipeline_done.mjs +144 -9
- package/skills/a2h-app-migrate/scripts/check_ui_batch_done.mjs +14 -1
- package/skills/a2h-app-migrate/scripts/check_utg_static_done.mjs +46 -5
- package/skills/a2h-app-migrate/scripts/diagnose.mjs +162 -0
- package/skills/a2h-app-migrate/scripts/env_preflight.mjs +79 -11
- package/skills/a2h-app-migrate/scripts/feature_scope.mjs +347 -0
- package/skills/a2h-app-migrate/scripts/human_review_gate.mjs +75 -4
- package/skills/a2h-app-migrate/scripts/infer_android_root.mjs +17 -1
- package/skills/a2h-app-migrate/scripts/ledger.mjs +64 -6
- package/skills/a2h-app-migrate/scripts/migration_manifest.mjs +351 -0
- package/skills/a2h-app-migrate/scripts/paths_preflight.mjs +9 -23
- package/skills/a2h-app-migrate/scripts/resume_plan.mjs +33 -9
- package/skills/a2h-app-migrate/scripts/reuse_static_utg.mjs +33 -1
- package/skills/a2h-app-migrate/scripts/run_dir.mjs +27 -17
- package/skills/a2h-app-migrate/scripts/scope_model.mjs +255 -0
- package/skills/a2h-app-migrate/scripts/scope_report.mjs +128 -0
- package/skills/a2h-app-migrate/scripts/source_fp.mjs +120 -0
- package/skills/a2h-app-migrate/test/test_android_index.mjs +12 -0
- package/skills/a2h-app-migrate/test/test_env_requirements.mjs +25 -10
- package/skills/a2h-app-migrate/test/test_feature_scope.mjs +217 -0
- package/skills/a2h-app-migrate/test/test_finalize.mjs +35 -7
- package/skills/a2h-app-migrate/test/test_hmos_fingerprint.mjs +7 -7
- package/skills/a2h-app-migrate/test/test_incremental_acceptance.mjs +145 -0
- package/skills/a2h-app-migrate/test/test_incremental_phase2.mjs +223 -0
- package/skills/a2h-app-migrate/test/test_incremental_phase2_acceptance.mjs +157 -0
- package/skills/a2h-app-migrate/test/test_incremental_profile.mjs +84 -0
- package/skills/a2h-app-migrate/test/test_infer_android_root.mjs +10 -0
- package/skills/a2h-app-migrate/test/test_json_io.mjs +1 -1
- package/skills/a2h-app-migrate/test/test_leaf_questions.mjs +39 -0
- package/skills/a2h-app-migrate/test/test_migration_manifest.mjs +225 -0
- package/skills/a2h-app-migrate/test/test_module_docs_done.mjs +33 -0
- package/skills/a2h-app-migrate/test/test_resume_plan.mjs +52 -0
- package/skills/a2h-app-migrate/test/test_resume_summary.mjs +26 -0
- package/skills/a2h-app-migrate/test/test_reuse_static_utg.mjs +36 -0
- package/skills/a2h-app-migrate/test/test_run_dir.mjs +71 -7
- package/skills/a2h-app-migrate/test/test_scope_model.mjs +172 -0
- package/skills/a2h-app-migrate/test/test_spec_engine_contract.mjs +13 -5
- package/skills/a2h-app-migrate/test/test_spec_gen_done.mjs +117 -0
- package/skills/a2h-app-migrate/test/test_spec_gen_gate.mjs +7 -3
- package/skills/a2h-app-migrate/test/test_spec_pipeline_done.mjs +170 -3
- package/skills/a2h-app-migrate/test/test_specs_json_preflight.mjs +1 -1
- package/skills/a2h-app-migrate/test/test_ui_batch_capture_audit.mjs +106 -0
- package/skills/a2h-app-migrate/test/test_ui_batch_done.mjs +12 -0
- package/skills/a2h-app-migrate/test/test_utg_static_done.mjs +38 -2
- package/skills/a2h-arch-generate/SKILL.md +20 -17
- package/skills/a2h-arch-generate/references/homegraph-workflow.md +10 -8
- package/skills/a2h-arch-generate/references/source-baseline.md +2 -2
- package/skills/a2h-arch-generate/scripts/cleanup_intermediates.mjs +34 -3
- package/skills/a2h-arch-generate/scripts/create_project.mjs +24 -1
- package/skills/a2h-arch-generate/scripts/inspect_and_route.mjs +29 -5
- package/skills/a2h-arch-generate/scripts/tests/run_tests.mjs +3 -3
- package/skills/a2h-arch-generate/scripts/tests/test_cleanup.mjs +17 -0
- package/skills/a2h-arch-generate/scripts/tests/test_router.mjs +26 -0
- package/skills/a2h-arch-generate/scripts/validate_incremental_docs.mjs +4 -2
- package/skills/a2h-arkts-logic-coder/SKILL.md +146 -17
- package/skills/a2h-arkts-logic-coder/references/ISSUES.md +2 -1
- package/skills/a2h-arkts-logic-coder/references/code-generation.md +59 -2
- package/skills/a2h-arkts-logic-coder/references/spec-design.md +42 -11
- package/skills/a2h-arkts-logic-coder/scripts/state_doc.mjs +328 -38
- package/skills/a2h-arkts-logic-coder/test/test_state_doc.mjs +244 -0
- package/skills/a2h-batch-ui-align/SKILL.md +72 -22
- package/skills/a2h-batch-ui-align/assets/ColorUtils.ets +16 -2
- package/skills/a2h-batch-ui-align/references/cards/alignment.md +5 -1
- package/skills/a2h-batch-ui-align/references/cards/geometry.md +5 -0
- package/skills/a2h-batch-ui-align/references/cards/interaction.md +2 -1
- package/skills/a2h-batch-ui-align/references/cards/resources.md +6 -4
- package/skills/a2h-batch-ui-align/references/cards/widgets.md +5 -0
- package/skills/a2h-batch-ui-align/references/cards/window.md +2 -1
- package/skills/a2h-batch-ui-align/references/checker-rules.md +236 -11
- package/skills/a2h-batch-ui-align/references/conversion-procedure.md +8 -5
- package/skills/a2h-batch-ui-align/references/host-dispatch.md +2 -0
- package/skills/a2h-batch-ui-align/references/incremental-scope.md +28 -9
- package/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-atomic-component-mapping-reference.md +7 -4
- package/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-layout-mapping-reference.md +28 -1
- package/skills/a2h-batch-ui-align/references/state-mgmt/_/350/243/205/351/245/260/345/231/250/351/200/237/346/237/245.md +30 -0
- package/skills/a2h-batch-ui-align/references/step3-capture.md +25 -6
- package/skills/a2h-batch-ui-align/references/step4-prepare.md +3 -0
- package/skills/a2h-batch-ui-align/references/step5-convert.md +26 -4
- package/skills/a2h-batch-ui-align/scripts/branch_coverage.mjs +155 -0
- package/skills/a2h-batch-ui-align/scripts/build_conversion_set.mjs +380 -16
- package/skills/a2h-batch-ui-align/scripts/capture_audit.mjs +474 -0
- package/skills/a2h-batch-ui-align/scripts/capture_fast.mjs +665 -0
- package/skills/a2h-batch-ui-align/scripts/capture_verify.mjs +552 -0
- package/skills/a2h-batch-ui-align/scripts/detach.mjs +5 -2
- package/skills/a2h-batch-ui-align/scripts/evidence_gate.mjs +39 -5
- package/skills/a2h-batch-ui-align/scripts/export_ui_info.mjs +19 -1
- package/skills/a2h-batch-ui-align/scripts/group_pack.mjs +134 -11
- package/skills/a2h-batch-ui-align/scripts/group_queue.mjs +213 -30
- package/skills/a2h-batch-ui-align/scripts/icon_coverage.mjs +147 -0
- package/skills/a2h-batch-ui-align/scripts/list_existing.mjs +141 -0
- package/skills/a2h-batch-ui-align/scripts/measure_pack.ts +231 -5
- package/skills/a2h-batch-ui-align/scripts/page_gap.mjs +210 -0
- package/skills/a2h-batch-ui-align/scripts/phase5_check.mjs +82 -8
- package/skills/a2h-batch-ui-align/scripts/progress_identity.mjs +208 -0
- package/skills/a2h-batch-ui-align/scripts/scroll_verdict.mjs +62 -0
- package/skills/a2h-batch-ui-align/scripts/shell_contract.mjs +21 -7
- package/skills/a2h-batch-ui-align/scripts/shell_requests.mjs +273 -0
- package/skills/a2h-batch-ui-align/scripts/state_doc.mjs +9 -4
- package/skills/a2h-batch-ui-align/scripts/static_check/core/baseline.ts +79 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/core/parse.ts +90 -2
- package/skills/a2h-batch-ui-align/scripts/static_check/core/scan.ts +44 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/main.ts +48 -5
- package/skills/a2h-batch-ui-align/scripts/static_check/registry.ts +24 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/a11y.ts +3 -17
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/attr_chain.ts +1 -19
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/dialog_backboard.ts +91 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/event_default_click.ts +179 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/hit_test.ts +339 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/image_source.ts +84 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/input_traps.ts +249 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/layout_placement.ts +234 -5
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/lottie_host.ts +145 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/media_tint.ts +45 -11
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/overlay_binds.ts +56 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/overlay_string.ts +96 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/padding_in_size.ts +60 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/percent_height_in_scroll.ts +3 -2
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/relative_container_height.ts +102 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/root_weight.ts +54 -4
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/runtime_traps.ts +440 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/scroll_align.ts +75 -23
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/swiper_index.ts +65 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/theme_color.ts +63 -2
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/waterflow_sections.ts +231 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/wide_constant_width.ts +4 -4
- package/skills/a2h-batch-ui-align/scripts/static_check/scan_file.ts +24 -2
- package/skills/a2h-batch-ui-align/scripts/tests/agent_cli.test.mjs +14 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_baseline.test.mjs +129 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_coolmall_runtime2.test.mjs +697 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_hit_test.test.mjs +298 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_input_runtime.test.mjs +514 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_layout_placement.test.mjs +224 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_overlay_lottie.test.mjs +199 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_rule_smoke.test.mjs +41 -7
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_runtime_api.test.mjs +346 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_theme_runtime.test.mjs +95 -0
- package/skills/a2h-batch-ui-align/scripts/tests/branch_coverage.test.mjs +116 -0
- package/skills/a2h-batch-ui-align/scripts/tests/build_conversion_set.test.mjs +126 -0
- package/skills/a2h-batch-ui-align/scripts/tests/build_conversion_set_scope.test.mjs +1 -0
- package/skills/a2h-batch-ui-align/scripts/tests/capture_audit.test.mjs +179 -0
- package/skills/a2h-batch-ui-align/scripts/tests/capture_fast.test.mjs +56 -0
- package/skills/a2h-batch-ui-align/scripts/tests/capture_gate.test.mjs +197 -0
- package/skills/a2h-batch-ui-align/scripts/tests/capture_review_fixes.test.mjs +322 -0
- package/skills/a2h-batch-ui-align/scripts/tests/color_utils_asset.test.mjs +19 -0
- package/skills/a2h-batch-ui-align/scripts/tests/evidence_gate.test.mjs +15 -0
- package/skills/a2h-batch-ui-align/scripts/tests/fixtures/icon_drift_search_sheet/SearchMenuDialog.buggy.ets +95 -0
- package/skills/a2h-batch-ui-align/scripts/tests/fixtures/icon_drift_search_sheet/page_0002_SearchMenuFragment/meta.json +21 -0
- package/skills/a2h-batch-ui-align/scripts/tests/fixtures/icon_drift_search_sheet/page_0002_SearchMenuFragment/screenshot.png +0 -0
- package/skills/a2h-batch-ui-align/scripts/tests/fixtures/icon_drift_search_sheet/page_0002_SearchMenuFragment/view.xml +35 -0
- package/skills/a2h-batch-ui-align/scripts/tests/group_pack_evidence.test.mjs +95 -0
- package/skills/a2h-batch-ui-align/scripts/tests/group_queue.test.mjs +155 -1
- package/skills/a2h-batch-ui-align/scripts/tests/icon_coverage.test.mjs +314 -0
- package/skills/a2h-batch-ui-align/scripts/tests/list_existing.test.mjs +157 -0
- package/skills/a2h-batch-ui-align/scripts/tests/measure_pack.test.mjs +5 -3
- package/skills/a2h-batch-ui-align/scripts/tests/page_gap.test.mjs +115 -0
- package/skills/a2h-batch-ui-align/scripts/tests/phase5_check.test.mjs +33 -2
- package/skills/a2h-batch-ui-align/scripts/tests/progress_identity.test.mjs +174 -0
- package/skills/a2h-batch-ui-align/scripts/tests/shell_contract.test.mjs +5 -0
- package/skills/a2h-batch-ui-align/scripts/tests/shell_requests.test.mjs +158 -0
- package/skills/a2h-batch-ui-align/scripts/tests/skill_doc_contract.test.mjs +12 -0
- package/skills/a2h-batch-ui-align/scripts/tests/state_doc.test.mjs +8 -0
- package/skills/a2h-coldstart-smoke-gate/SKILL.md +7 -4
- package/skills/a2h-dashboard-render/test/test_device_locale_dialogs.mjs +17 -0
- package/skills/a2h-module-semantic-docs/SKILL.md +51 -13
- package/skills/a2h-module-semantic-docs/scripts/scan_modules.mjs +66 -11
- package/skills/a2h-module-semantic-docs/test/test_incremental_fingerprint.mjs +94 -0
- package/skills/a2h-page-specgen/SKILL.md +124 -20
- package/skills/a2h-page-specgen/references/behavior-ledger.md +1170 -0
- package/skills/a2h-page-specgen/references/body-language.md +11 -9
- package/skills/a2h-page-specgen/references/evidence.md +35 -0
- package/skills/a2h-page-specgen/references/execution-model.md +135 -26
- package/skills/a2h-page-specgen/references/footprint-and-grouping.md +20 -15
- package/skills/a2h-page-specgen/references/gates.md +120 -52
- package/skills/a2h-page-specgen/references/page-inventory.md +69 -22
- package/skills/a2h-page-specgen/references/scenario-authoring.md +272 -0
- package/skills/a2h-page-specgen/references/spec-example.md +312 -0
- package/skills/a2h-page-specgen/references/spec-template.md +112 -109
- package/skills/a2h-page-specgen/scripts/behavior-audit.mjs +2436 -0
- package/skills/a2h-page-specgen/scripts/behavior-discovery.mjs +1833 -0
- package/skills/a2h-page-specgen/scripts/behavior-model.mjs +181 -0
- package/skills/a2h-page-specgen/scripts/behavior-reconcile.mjs +1205 -0
- package/skills/a2h-page-specgen/scripts/dispatch.mjs +8 -5
- package/skills/a2h-page-specgen/scripts/entry-evidence.mjs +1123 -0
- package/skills/a2h-page-specgen/scripts/facts-build.mjs +170 -61
- package/skills/a2h-page-specgen/scripts/finalize.mjs +466 -63
- package/skills/a2h-page-specgen/scripts/footprint.mjs +302 -180
- package/skills/a2h-page-specgen/scripts/gate.mjs +372 -82
- package/skills/a2h-page-specgen/scripts/interactions.mjs +215 -8
- package/skills/a2h-page-specgen/scripts/inventory.mjs +102 -0
- package/skills/a2h-page-specgen/scripts/lib/contracts.mjs +116 -216
- package/skills/a2h-page-specgen/scripts/lib/draft-store.mjs +105 -13
- package/skills/a2h-page-specgen/scripts/lib/graph-evidence.mjs +235 -0
- package/skills/a2h-page-specgen/scripts/lib/hg.mjs +520 -12
- package/skills/a2h-page-specgen/scripts/lib/homegraph-process.mjs +102 -0
- package/skills/a2h-page-specgen/scripts/lib/homegraph-query.mjs +161 -0
- package/skills/a2h-page-specgen/scripts/lib/ledger.mjs +129 -6
- package/skills/a2h-page-specgen/scripts/lib/main-module.mjs +24 -0
- package/skills/a2h-page-specgen/scripts/lib/operation-reviews.mjs +913 -0
- package/skills/a2h-page-specgen/scripts/lib/prose.mjs +12 -8
- package/skills/a2h-page-specgen/scripts/lib/recovery-policy.mjs +28 -0
- package/skills/a2h-page-specgen/scripts/lib/scope.mjs +355 -0
- package/skills/a2h-page-specgen/scripts/lib/semantic-detail.mjs +353 -0
- package/skills/a2h-page-specgen/scripts/lib/source-text.mjs +106 -0
- package/skills/a2h-page-specgen/scripts/operation-evidence.mjs +1542 -0
- package/skills/a2h-page-specgen/scripts/prepare.mjs +470 -122
- package/skills/a2h-page-specgen/scripts/render.mjs +11 -34
- package/skills/a2h-page-specgen/scripts/report.mjs +339 -6
- package/skills/a2h-page-specgen/scripts/submission.mjs +253 -88
- package/skills/a2h-page-specgen/scripts/submit.mjs +12 -6
- package/skills/a2h-page-specgen/scripts/test/acceptance/acceptance.mjs +288 -7
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.java +15 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.json +26 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.prompt.md +347 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.worker.md +298 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.java +36 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.json +43 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.prompt.md +347 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.worker.md +298 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.discovery.json +2694 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.json +726 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.post-review.json +108 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.prompt.md +347 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.review.md +65 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.worker.md +265 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.java +47 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.json +54 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.prompt.md +347 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.worker.md +298 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/branch-checklist.md +32 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/gate-results.json +22 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/manifest.json +111 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/portability.test.mjs +141 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/review.md +22 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/run.mjs +515 -0
- package/skills/a2h-page-specgen/scripts/test/android-entry-evidence.test.mjs +585 -0
- package/skills/a2h-page-specgen/scripts/test/android-operation-evidence.test.mjs +755 -0
- package/skills/a2h-page-specgen/scripts/test/behavior-audit-group.test.mjs +543 -0
- package/skills/a2h-page-specgen/scripts/test/behavior-audit-post.test.mjs +652 -0
- package/skills/a2h-page-specgen/scripts/test/behavior-audit-pre.test.mjs +1231 -0
- package/skills/a2h-page-specgen/scripts/test/behavior-component-gate.test.mjs +494 -0
- package/skills/a2h-page-specgen/scripts/test/behavior-discovery.test.mjs +1513 -0
- package/skills/a2h-page-specgen/scripts/test/behavior-finalize.test.mjs +758 -0
- package/skills/a2h-page-specgen/scripts/test/behavior-fixtures.mjs +623 -0
- package/skills/a2h-page-specgen/scripts/test/behavior-model.test.mjs +116 -0
- package/skills/a2h-page-specgen/scripts/test/behavior-reconcile.test.mjs +795 -0
- package/skills/a2h-page-specgen/scripts/test/behavior-regression.test.mjs +883 -0
- package/skills/a2h-page-specgen/scripts/test/contracts.test.mjs +135 -137
- package/skills/a2h-page-specgen/scripts/test/entry-evidence.test.mjs +475 -0
- package/skills/a2h-page-specgen/scripts/test/facts.test.mjs +40 -1
- package/skills/a2h-page-specgen/scripts/test/finalize.test.mjs +178 -9
- package/skills/a2h-page-specgen/scripts/test/fixtures/hg.mkdb.mjs +19 -1
- package/skills/a2h-page-specgen/scripts/test/fixtures/src/BottomPanels.java +14 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/src/BottomPanels.kt +14 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/src/BottomPanelsKotlinForms.kt +12 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/src/ChildContent.java +6 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/src/ComposeLifecycle.kt +26 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/src/LifecycleCallAndOverride.java +10 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/src/LifecycleHooks.kt +31 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/src/ManyLifecycleHooks.kt +12 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/src/RefreshOnResume.java +7 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/src/RefreshResultNoise.kt +36 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/src/SelectionView.java +5 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/src/ShowPage.vue +12 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/src/ThirdPartyLifecycle.kt +25 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/src/fragment_detail.xml +1 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/App.vue +1 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/bundle-conflict-record.json +17 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/bundle-record.json +17 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/manifest.json +3 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/pages/list/index.vue +80 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/pages.json +14 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/source-record.json +15 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/src/components/RefreshPanel.vue +15 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/src/composables/useRefresh.ts +50 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/src/pages/help/index.vue +9 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/uniapp-source/src/state/store.ts +4 -0
- package/skills/a2h-page-specgen/scripts/test/footprint-resolve.test.mjs +459 -188
- package/skills/a2h-page-specgen/scripts/test/gate-partial.test.mjs +89 -0
- package/skills/a2h-page-specgen/scripts/test/gate.test.mjs +869 -13
- package/skills/a2h-page-specgen/scripts/test/graph-evidence.test.mjs +332 -0
- package/skills/a2h-page-specgen/scripts/test/helpers.mjs +139 -5
- package/skills/a2h-page-specgen/scripts/test/hg.test.mjs +378 -0
- package/skills/a2h-page-specgen/scripts/test/homegraph-process-fixture.mjs +130 -0
- package/skills/a2h-page-specgen/scripts/test/homegraph-query.test.mjs +288 -0
- package/skills/a2h-page-specgen/scripts/test/integration.test.mjs +69 -2
- package/skills/a2h-page-specgen/scripts/test/interactions.test.mjs +267 -2
- package/skills/a2h-page-specgen/scripts/test/inventory.test.mjs +111 -0
- package/skills/a2h-page-specgen/scripts/test/keys.test.mjs +10 -8
- package/skills/a2h-page-specgen/scripts/test/ledger-lock.test.mjs +77 -0
- package/skills/a2h-page-specgen/scripts/test/ledger.test.mjs +1 -1
- package/skills/a2h-page-specgen/scripts/test/main-module.test.mjs +43 -0
- package/skills/a2h-page-specgen/scripts/test/operation-reviews.test.mjs +1002 -0
- package/skills/a2h-page-specgen/scripts/test/plan-build.test.mjs +143 -51
- package/skills/a2h-page-specgen/scripts/test/prepare-homegraph-reproduction.mjs +365 -0
- package/skills/a2h-page-specgen/scripts/test/prepare-homegraph.test.mjs +569 -0
- package/skills/a2h-page-specgen/scripts/test/prepare-index.test.mjs +42 -2
- package/skills/a2h-page-specgen/scripts/test/prepare-pipeline.test.mjs +326 -0
- package/skills/a2h-page-specgen/scripts/test/prompt-tpl.test.mjs +171 -3
- package/skills/a2h-page-specgen/scripts/test/prose.test.mjs +13 -5
- package/skills/a2h-page-specgen/scripts/test/protocol-docs.test.mjs +365 -1
- package/skills/a2h-page-specgen/scripts/test/recovery-e2e.test.mjs +102 -7
- package/skills/a2h-page-specgen/scripts/test/recovery-policy.test.mjs +14 -0
- package/skills/a2h-page-specgen/scripts/test/recovery.test.mjs +1308 -72
- package/skills/a2h-page-specgen/scripts/test/render.test.mjs +85 -42
- package/skills/a2h-page-specgen/scripts/test/report.test.mjs +296 -0
- package/skills/a2h-page-specgen/scripts/test/review-followup.test.mjs +467 -0
- package/skills/a2h-page-specgen/scripts/test/scope.test.mjs +292 -0
- package/skills/a2h-page-specgen/scripts/test/semantic-detail.test.mjs +949 -0
- package/skills/a2h-page-specgen/scripts/test/submit.test.mjs +645 -115
- package/skills/a2h-page-specgen/scripts/test/uniapp-operation-evidence.test.mjs +639 -0
- package/skills/a2h-page-specgen/scripts/test/utg-footprint-contract.test.mjs +274 -0
- package/skills/a2h-page-specgen/scripts/test/waker-process.test.mjs +101 -65
- package/skills/a2h-page-specgen/scripts/test/waker.test.mjs +88 -74
- package/skills/a2h-page-specgen/scripts/test/watchdog.test.mjs +30 -1
- package/skills/a2h-page-specgen/scripts/waker.mjs +79 -12
- package/skills/a2h-page-specgen/scripts/watchdog.mjs +18 -17
- package/skills/a2h-resource-convert/SKILL.md +9 -1
- package/skills/a2h-resource-convert/references/code-vector-icon-rules.md +2 -1
- package/skills/a2h-resource-convert/references/incremental-page-migration.md +23 -2
- package/skills/a2h-resource-convert/references/lottie-conversion-rules.md +7 -0
- package/skills/a2h-resource-convert/references/step4-resource-types.md +2 -0
- package/skills/a2h-resource-convert/scripts/a2h_resource_convert.ts +67 -3
- package/skills/a2h-resource-convert/scripts/a2h_resource_incremental.ts +68 -0
- package/skills/a2h-resource-convert/scripts/code_vector_icons.ts +45 -3
- package/skills/a2h-resource-convert/scripts/extract_page_resources.ts +42 -5
- package/skills/a2h-resource-convert/scripts/lottie_hosts.ts +415 -0
- package/skills/a2h-resource-convert/scripts/lottie_refs.ts +398 -0
- package/skills/a2h-resource-convert/scripts/merge_mapping.ts +316 -0
- package/skills/a2h-resource-convert/scripts/svg_fidelity_check.ts +2 -1
- package/skills/a2h-resource-convert/scripts/tests/code_vector_guard.test.mjs +75 -0
- package/skills/a2h-resource-convert/scripts/tests/lottie_hosts.test.mjs +222 -0
- package/skills/a2h-resource-convert/scripts/tests/lottie_incremental.test.mjs +178 -0
- package/skills/a2h-resource-convert/scripts/tests/merge_mapping.test.mjs +201 -0
- package/skills/a2h-spec-design-pipeline/SKILL.md +48 -72
- package/skills/a2h-spec-design-pipeline/references/coding-loop.md +123 -37
- package/skills/a2h-spec-design-pipeline/references/execution-model.md +40 -8
- package/skills/a2h-spec-design-pipeline/references/final-report-template.md +5 -4
- package/skills/a2h-spec-design-pipeline/references/homegraph-cli.md +229 -0
- package/skills/a2h-spec-design-pipeline/references/initialization.md +37 -5
- package/skills/a2h-spec-design-pipeline/references/merge-queue.md +126 -23
- package/skills/a2h-spec-design-pipeline/references/permission-index.json +206 -0
- package/skills/a2h-spec-design-pipeline/references/post-loop.md +23 -0
- package/skills/a2h-spec-design-pipeline/references/resolver-prompt.md +7 -1
- package/skills/a2h-spec-design-pipeline/references/review-loop.md +46 -0
- package/skills/a2h-spec-design-pipeline/references/scripts.md +38 -14
- package/skills/a2h-spec-design-pipeline/references/shared-layer.md +127 -4
- package/skills/a2h-spec-design-pipeline/references/state-and-resume.md +90 -24
- package/skills/a2h-spec-design-pipeline/references/static-defect-gate.md +65 -34
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/config/ruleMeta.json +11 -1
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/config/ruleSet.json +10 -2
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/data/README.md +47 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/data/api-param-contract.json +31 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/data/api-permission-map.json +698 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/api-permission-declared-cn.md +96 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/api-permission-declared-en.md +103 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/arkui-runtime-pitfall-cn.md +124 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/arkui-runtime-pitfall-en.md +138 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/platform-api-contract-cn.md +106 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/platform-api-contract-en.md +113 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/ApiPermissionDeclaredCheck.js +705 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/ArkUIRuntimePitfallCheck.js +1063 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/PlatformApiContractCheck.js +473 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/{HttpExtraDataEmptyStringCheck.js → platform/ExtraDataSubCheck.js} +27 -30
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/index.js +4 -2
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/package.json +3 -2
- package/skills/a2h-spec-design-pipeline/scripts/check_design_map.ts +108 -0
- package/skills/a2h-spec-design-pipeline/scripts/check_permissions.ts +420 -0
- package/skills/a2h-spec-design-pipeline/scripts/check_review_evidence.ts +45 -0
- package/skills/a2h-spec-design-pipeline/scripts/dispatch/evidence.mjs +55 -2
- package/skills/a2h-spec-design-pipeline/scripts/dispatch/fold.mjs +138 -7
- package/skills/a2h-spec-design-pipeline/scripts/dispatch/landing.mjs +10 -13
- package/skills/a2h-spec-design-pipeline/scripts/dispatch/progress.mjs +21 -2
- package/skills/a2h-spec-design-pipeline/scripts/dispatch/reconcile.mjs +63 -4
- package/skills/a2h-spec-design-pipeline/scripts/dispatch/wait.mjs +32 -2
- package/skills/a2h-spec-design-pipeline/scripts/dispatch.mjs +109 -13
- package/skills/a2h-spec-design-pipeline/scripts/ensure_index.ts +866 -0
- package/skills/a2h-spec-design-pipeline/scripts/fixtures/homecheck-stub.cjs +47 -0
- package/skills/a2h-spec-design-pipeline/scripts/homecheck_scan.ts +12 -17
- package/skills/a2h-spec-design-pipeline/scripts/plan_groups.ts +172 -7
- package/skills/a2h-spec-design-pipeline/scripts/resolver_prompt.ts +36 -16
- package/skills/a2h-spec-design-pipeline/scripts/sync_permission_index.ts +340 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_api_permission_declared.ts +281 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_arkui_runtime_pitfall.ts +690 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_check_design_map.ts +46 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_check_permissions.ts +201 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_commands.mjs +27 -3
- package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_e2e.mjs +20 -7
- package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_evidence.mjs +143 -13
- package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_fold.mjs +168 -7
- package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_landing.mjs +139 -2
- package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_progress.mjs +25 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_reconcile.mjs +92 -4
- package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_wait.mjs +37 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_ensure_index.ts +572 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_ensure_index_real.ts +56 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_homecheck_scan.ts +4 -5
- package/skills/a2h-spec-design-pipeline/scripts/test_homegraph_docs.ts +217 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_permission_index.ts +214 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_plan_groups.ts +155 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_platform_api_contract.ts +308 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_resolver_prompt.ts +59 -8
- package/skills/a2h-spec-design-pipeline/scripts/test_shared_layer_docs.ts +44 -0
- package/skills/a2h-spec-generate/SKILL.md +2 -2
- package/skills/a2h-spec-generate/references/specs.schema.json +24 -11
- package/skills/a2h-spec-generate/scripts/ensure-index.mjs +1 -2
- package/skills/a2h-spec-generate/test/ensure-index.test.mjs +1 -2
- package/skills/a2h-utg-explorer/SKILL.md +9 -3
- package/skills/a2h-utg-explorer/references/architecture.md +3 -0
- package/skills/a2h-utg-explorer/scripts/audit.mjs +8 -2
- package/skills/a2h-utg-explorer/scripts/compile_tasks.mjs +56 -5
- package/skills/a2h-utg-explorer/scripts/direct_launch.mjs +47 -2
- package/skills/a2h-utg-explorer/scripts/hybrid_route_cdp.mjs +376 -0
- package/skills/a2h-utg-explorer/scripts/plan.mjs +8 -0
- package/skills/a2h-utg-explorer/scripts/recover_d.mjs +288 -21
- package/skills/a2h-utg-explorer/scripts/report.mjs +89 -0
- package/skills/a2h-utg-explorer/scripts/run_cycle.mjs +67 -10
- package/skills/a2h-utg-explorer/scripts/run_device.mjs +10 -2
- package/skills/a2h-utg-explorer/scripts/seed_recipes.mjs +426 -0
- package/skills/a2h-utg-explorer/scripts/tests/blank_wait.test.mjs +126 -0
- package/skills/a2h-utg-explorer/scripts/tests/default_override.test.mjs +109 -0
- package/skills/a2h-utg-explorer/scripts/tests/device_locale_dialogs.test.mjs +29 -0
- package/skills/a2h-utg-explorer/scripts/tests/diagnostics.test.mjs +254 -0
- package/skills/a2h-utg-explorer/scripts/tests/foreground_spelling.test.mjs +155 -0
- package/skills/a2h-utg-explorer/scripts/tests/hybrid_route.test.mjs +120 -0
- package/skills/a2h-utg-explorer/scripts/tests/hybrid_route_identity.test.mjs +146 -0
- package/skills/a2h-utg-explorer/scripts/tests/interruptions.test.mjs +122 -0
- package/skills/a2h-utg-explorer/scripts/tests/launch_bridge.test.mjs +15 -0
- package/skills/a2h-utg-explorer/scripts/tests/pr169_review_fixes.test.mjs +218 -0
- package/skills/a2h-utg-explorer/scripts/tests/pr191_review_fixes.test.mjs +292 -0
- package/skills/a2h-utg-explorer/scripts/tests/recover_d_grounding.test.mjs +164 -0
- package/skills/a2h-utg-explorer/scripts/tests/replay_reroute.test.mjs +143 -0
- package/skills/a2h-utg-explorer/scripts/tests/run_cycle.test.mjs +6 -2
- package/skills/a2h-utg-explorer/scripts/tests/run_cycle_follow.test.mjs +35 -0
- package/skills/a2h-utg-explorer/scripts/tests/seed_recipes.test.mjs +261 -0
- package/skills/a2h-utg-explorer/scripts/utg_explorer/adapters.mjs +122 -4
- package/skills/a2h-utg-explorer/scripts/utg_explorer/diagnostics.mjs +196 -0
- package/skills/a2h-utg-explorer/scripts/utg_explorer/hybrid_route.mjs +140 -0
- package/skills/a2h-utg-explorer/scripts/utg_explorer/semantics.mjs +138 -4
- package/skills/a2h-utg-explorer/scripts/utg_explorer/state_phase.mjs +47 -0
- package/skills/a2h-utg-explorer/scripts/utg_explorer/strings.mjs +22 -13
- package/skills/a2h-utg-explorer/scripts/utg_explorer/task_runner.mjs +718 -42
- package/skills/a2h-utg-explorer/scripts/variant.mjs +57 -11
- package/skills/a2h-utg-static/SKILL.md +6 -2
- package/skills/a2h-utg-static/scripts/assemble.mjs +65 -0
- package/skills/a2h-utg-static/scripts/click_paths.mjs +116 -5
- package/skills/a2h-utg-static/scripts/compose_body_text.mjs +3 -3
- package/skills/a2h-utg-static/scripts/compose_overlay.mjs +8 -1
- package/skills/a2h-utg-static/scripts/compose_titles.mjs +5 -5
- package/skills/a2h-utg-static/scripts/compose_widgets.mjs +4 -4
- package/skills/a2h-utg-static/scripts/data_model.mjs +590 -0
- package/skills/a2h-utg-static/scripts/data_producers.mjs +431 -0
- package/skills/a2h-utg-static/scripts/hybrid_scope.mjs +46 -1
- package/skills/a2h-utg-static/scripts/label_resolve.mjs +49 -4
- package/skills/a2h-utg-static/scripts/lib/hybrid-provenance.mjs +201 -0
- package/skills/a2h-utg-static/scripts/lib/uniapp-routes.mjs +195 -0
- package/skills/a2h-utg-static/scripts/menu_nav.mjs +1 -1
- package/skills/a2h-utg-static/scripts/nl_hints.mjs +32 -4
- package/skills/a2h-utg-static/scripts/run_pipeline.mjs +86 -4
- package/skills/a2h-utg-static/scripts/tests/test_carry_answers.mjs +30 -0
- package/skills/a2h-utg-static/scripts/tests/test_compose_res_text.mjs +18 -0
- package/skills/a2h-utg-static/scripts/tests/test_data_model.mjs +120 -0
- package/skills/a2h-utg-static/scripts/tests/test_data_producers.mjs +114 -0
- package/skills/a2h-utg-static/scripts/tests/test_guard_kinds_locale.mjs +12 -0
- package/skills/a2h-utg-static/scripts/tests/test_hybrid_provenance.mjs +150 -0
- package/skills/a2h-utg-static/scripts/tests/test_hybrid_scope.mjs +165 -1
- package/skills/a2h-utg-static/scripts/tests/test_library_activity.mjs +45 -0
- package/skills/a2h-utg-static/scripts/tests/test_module_strings.mjs +35 -1
- package/skills/a2h-utg-static/scripts/tests/test_nl_hints_default_override.mjs +50 -0
- package/skills/a2h-utg-static/scripts/tests/test_pipeline_llm_phases.mjs +21 -0
- package/skills/a2h-utg-static/scripts/tests/test_pr169_review_fixes.mjs +172 -0
- package/skills/a2h-utg-static/scripts/tests/test_redirect_path_cost.mjs +136 -0
- package/skills/a2h-utg-static/scripts/tests/test_uniapp_route_jump.mjs +175 -0
- package/skills/a2h-utg-static/scripts/tests/test_uniapp_routes.mjs +161 -0
- package/skills/a2h-utg-static/scripts/tests/test_uniapp_source.mjs +99 -0
- package/skills/a2h-utg-static/scripts/tests/test_utg_specgen_boundary.mjs +45 -0
- package/skills/a2h-utg-static/scripts/tests/test_vm_nav_helper_navigate.mjs +21 -0
- package/skills/a2h-utg-static/scripts/uniapp_nav.mjs +112 -69
- package/skills/a2h-utg-static/scripts/vm_nav.mjs +9 -1
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/http-extra-data-empty-string-cn.md +0 -55
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/http-extra-data-empty-string-en.md +0 -60
- package/skills/a2h-spec-design-pipeline/scripts/ensure_wt_index.ts +0 -948
- package/skills/a2h-spec-design-pipeline/scripts/test_ensure_wt_index.ts +0 -1014
|
@@ -8,8 +8,10 @@
|
|
|
8
8
|
* recover_d.mjs apply <campaign> --config <config.json>
|
|
9
9
|
*
|
|
10
10
|
* Exports: MAX_SETUP_STEPS, REPLAY, MAX_REPLAY_STEPS, load, snapshotNames, outputName, extract,
|
|
11
|
-
* checkSteps,
|
|
11
|
+
* checkSteps, knownTexts, screenTexts, fixtureServerTexts, groundingProblem, stepFailedPhases, stepFailures,
|
|
12
|
+
* revisablePhases, validate, apply, main
|
|
12
13
|
*/
|
|
14
|
+
import * as fs from 'node:fs';
|
|
13
15
|
import * as path from 'node:path';
|
|
14
16
|
import { pathToFileURL } from 'node:url';
|
|
15
17
|
import {
|
|
@@ -21,6 +23,7 @@ import { addItemFilterArgs, nodeFilter, scopeOf, unmappedOnly } from './utg_expl
|
|
|
21
23
|
import { KEYS, MAX_STEPS, STEP_TYPES, overrideFor, selectorProblem, toRunner } from './recover_b.mjs';
|
|
22
24
|
import { unrunnable } from './close_phases.mjs';
|
|
23
25
|
import { addVariant } from './variant.mjs';
|
|
26
|
+
import { normalized } from './utg_explorer/strings.mjs';
|
|
24
27
|
|
|
25
28
|
export const MAX_SETUP_STEPS = 25;
|
|
26
29
|
export const REPLAY = '.replay.json';
|
|
@@ -91,6 +94,243 @@ export function probeFailures(doc, root) {
|
|
|
91
94
|
});
|
|
92
95
|
}
|
|
93
96
|
|
|
97
|
+
/** Page-catalog fields holding texts the page's own source renders. */
|
|
98
|
+
const CATALOG_TEXT_FIELDS = ['titles', 'row_titles', 'entry_labels', 'hint_titles', 'body_titles',
|
|
99
|
+
'shared_titles', 'shared_texts', 'source_texts'];
|
|
100
|
+
/** Texts listed per page in the worklist: enough for a recipe's taps, small enough to read. */
|
|
101
|
+
const SCREEN_TEXTS_PER_PAGE = 80;
|
|
102
|
+
|
|
103
|
+
const textsOfNodes = (nodes) => (Array.isArray(nodes) ? nodes : [])
|
|
104
|
+
.filter((n) => T(get(n, 'visible', true)))
|
|
105
|
+
.flatMap((n) => [get(n, 'text'), get(n, 'content_desc')])
|
|
106
|
+
.filter((t) => typeof t === 'string' && t.trim().length > 0);
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* screenTexts(doc): static page id -> the texts a tap may name on it, as the device shows them
|
|
110
|
+
* (texts of every capture mapped to that page) followed by the page's own source texts (page
|
|
111
|
+
* catalog). Device texts come first: a recipe tap matches the tree exactly, and the device's
|
|
112
|
+
* spelling (「你好,\n欢迎…」) is the one that matches.
|
|
113
|
+
*/
|
|
114
|
+
export function screenTexts(doc) {
|
|
115
|
+
const out = new Map();
|
|
116
|
+
const add = (sid, t) => {
|
|
117
|
+
if (!T(sid) || typeof t !== 'string' || !t.trim()) { return; }
|
|
118
|
+
if (!out.has(sid)) { out.set(sid, []); }
|
|
119
|
+
const list = out.get(sid);
|
|
120
|
+
if (!list.includes(t)) { list.push(t); }
|
|
121
|
+
};
|
|
122
|
+
const events = get(doc ?? {}, 'events', []) || [];
|
|
123
|
+
const pageOf = new Map();
|
|
124
|
+
for (const e of events) {
|
|
125
|
+
if (get(e, 'kind') !== 'mapping') { continue; }
|
|
126
|
+
const p = get(e, 'payload', {});
|
|
127
|
+
if (T(get(p, 'observation_id')) && T(get(p, 'static_id'))) { pageOf.set(p.observation_id, p.static_id); }
|
|
128
|
+
}
|
|
129
|
+
for (const e of events) {
|
|
130
|
+
if (get(e, 'kind') !== 'observation') { continue; }
|
|
131
|
+
const p = get(e, 'payload', {});
|
|
132
|
+
const sid = pageOf.get(get(p, 'observation_id'));
|
|
133
|
+
if (sid) { for (const t of textsOfNodes(get(p, 'nodes'))) { add(sid, t); } }
|
|
134
|
+
}
|
|
135
|
+
const catalog = get(doc ?? {}, 'page_catalog', {}) || {};
|
|
136
|
+
for (const sid of keysOf(catalog)) {
|
|
137
|
+
for (const f of CATALOG_TEXT_FIELDS) {
|
|
138
|
+
for (const t of or_(get(catalog[sid], f), [])) { add(sid, t); }
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
return out;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
/**
|
|
145
|
+
* knownTexts(doc): every text (normalized) seen on any capture of the campaign, mapped or not,
|
|
146
|
+
* plus every page's own source texts. Empty when the campaign carries neither (no evidence to
|
|
147
|
+
* check a recipe against).
|
|
148
|
+
*/
|
|
149
|
+
export function knownTexts(doc) {
|
|
150
|
+
const known = new Set();
|
|
151
|
+
for (const e of get(doc ?? {}, 'events', []) || []) {
|
|
152
|
+
if (get(e, 'kind') === 'observation') {
|
|
153
|
+
for (const t of textsOfNodes(get(get(e, 'payload', {}), 'nodes'))) { known.add(normalized(t)); }
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
for (const list of screenTexts({ page_catalog: get(doc ?? {}, 'page_catalog', {}) }).values()) {
|
|
157
|
+
for (const t of list) { known.add(normalized(t)); }
|
|
158
|
+
}
|
|
159
|
+
known.delete('');
|
|
160
|
+
return known;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
/** Edit distance over code points, stopping early once it exceeds `cap`. */
|
|
164
|
+
function editDistance(a, b, cap) {
|
|
165
|
+
const x = [...a]; const y = [...b];
|
|
166
|
+
if (Math.abs(x.length - y.length) > cap) { return cap + 1; }
|
|
167
|
+
let prev = Array.from({ length: y.length + 1 }, (_, j) => j);
|
|
168
|
+
for (let i = 1; i <= x.length; i++) {
|
|
169
|
+
const cur = [i];
|
|
170
|
+
let best = i;
|
|
171
|
+
for (let j = 1; j <= y.length; j++) {
|
|
172
|
+
cur[j] = Math.min(prev[j] + 1, cur[j - 1] + 1, prev[j - 1] + (x[i - 1] === y[j - 1] ? 0 : 1));
|
|
173
|
+
best = Math.min(best, cur[j]);
|
|
174
|
+
}
|
|
175
|
+
if (best > cap) { return cap + 1; }
|
|
176
|
+
prev = cur;
|
|
177
|
+
}
|
|
178
|
+
return prev[y.length];
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
/** The known text closest to `text` (a typo, one character added or dropped), or null. */
|
|
182
|
+
function closestText(text, known) {
|
|
183
|
+
const n = [...text].length;
|
|
184
|
+
const cap = Math.max(1, Math.floor(n / 3));
|
|
185
|
+
let best = null; let bestD = cap + 1;
|
|
186
|
+
for (const k of known) {
|
|
187
|
+
const d = editDistance(text, k, cap);
|
|
188
|
+
if (d < bestD || (d === bestD && best !== null && k < best)) { best = k; bestD = d; }
|
|
189
|
+
}
|
|
190
|
+
return bestD <= cap ? best : null;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
const SELECTOR_STEP_FIELDS = { click: ['selector'], long_click: ['selector'], drag: ['selector', 'to'] };
|
|
194
|
+
/** Largest fixture-server file read for its texts (a feed, a JSON reply); larger ones are media. */
|
|
195
|
+
const FIXTURE_TEXT_MAX_BYTES = 2 * 1024 * 1024;
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* fixtureServerTexts(config): the contents of the files already in `fixture_server_dir` (the
|
|
199
|
+
* worklist shows them as `fixture_server_files` / `fixture_feed`), so a recipe may tap an item they
|
|
200
|
+
* serve that no capture has shown yet (an episode title of feed.xml). Files over
|
|
201
|
+
* FIXTURE_TEXT_MAX_BYTES are skipped. Empty without a configured, existing directory.
|
|
202
|
+
*/
|
|
203
|
+
export function fixtureServerTexts(config) {
|
|
204
|
+
const dir = T(get(config ?? {}, 'fixture_server_dir')) ? pathStr(config.fixture_server_dir) : null;
|
|
205
|
+
if (!dir || !pIsDir(dir)) { return []; }
|
|
206
|
+
const out = [];
|
|
207
|
+
for (const e of listDirNames(dir)) {
|
|
208
|
+
const p = pJoin(dir, e.name);
|
|
209
|
+
if (!pIsFile(p) || fs.statSync(p).size > FIXTURE_TEXT_MAX_BYTES) { continue; }
|
|
210
|
+
try { out.push(readText(p, { encoding: 'utf-8' })); } catch { /* unreadable: not evidence */ }
|
|
211
|
+
}
|
|
212
|
+
return out;
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
/**
|
|
216
|
+
* groundingProblem(r, known, extra): null when every text / content_desc a recipe step taps
|
|
217
|
+
* (its selector and `within` scope, in `steps`, `probe_steps` and `task_steps`) is a text seen on
|
|
218
|
+
* a capture or rendered by a page's source (`known`, see knownTexts), or one the recipe brings
|
|
219
|
+
* itself (a typed value, a text inside one of its new fixture files, `extra`), or a text inside a
|
|
220
|
+
* file the fixture server already serves (`serverFiles`, see fixtureServerTexts). Otherwise the
|
|
221
|
+
* first unknown text, with the closest known one when there is one. An empty `known` checks nothing.
|
|
222
|
+
* Measured (coolmall 2026-11-18): a login recipe tapped 「请输入手机号码」 while the field reads
|
|
223
|
+
* 「请输入手机号」 (captured, and in the page's source texts); the phase blocked on that step and
|
|
224
|
+
* every logged-in page (25) stayed uncaptured.
|
|
225
|
+
*/
|
|
226
|
+
export function groundingProblem(r, known, extra = [], serverFiles = []) {
|
|
227
|
+
if (!known || !known.size) { return null; }
|
|
228
|
+
const own = new Set([...extra].map(normalized));
|
|
229
|
+
const sequences = [['steps', or_(get(r, 'steps'), [])], ['probe_steps', or_(get(r, 'probe_steps'), [])]];
|
|
230
|
+
const ts = or_(get(r, 'task_steps'), {});
|
|
231
|
+
for (const tid of keysOf(ts)) { sequences.push([tid, or_(ts[tid], [])]); }
|
|
232
|
+
for (const [, steps] of sequences) {
|
|
233
|
+
for (const s of steps) { if (get(s, 'type') === 'type' && typeof get(s, 'text') === 'string') { own.add(normalized(s.text)); } }
|
|
234
|
+
}
|
|
235
|
+
const fileTexts = [...or_(get(r, 'fixture_files'), []).map((f) => pyStr(get(f, 'content', ''))), ...serverFiles];
|
|
236
|
+
const isKnown = (t) => {
|
|
237
|
+
const k = normalized(t);
|
|
238
|
+
return known.has(k) || own.has(k) || fileTexts.some((c) => c.includes(t));
|
|
239
|
+
};
|
|
240
|
+
for (const [where, steps] of sequences) {
|
|
241
|
+
for (let i = 0; i < steps.length; i++) {
|
|
242
|
+
for (const f of get(SELECTOR_STEP_FIELDS, get(steps[i], 'type'), [])) {
|
|
243
|
+
const sel = get(steps[i], f);
|
|
244
|
+
for (const part of [sel, get(sel ?? {}, 'within')]) {
|
|
245
|
+
if (!isDict(part)) { continue; }
|
|
246
|
+
for (const key of ['text', 'content_desc']) {
|
|
247
|
+
const t = get(part, key);
|
|
248
|
+
if (typeof t !== 'string' || isKnown(t)) { continue; }
|
|
249
|
+
const near = closestText(normalized(t), known);
|
|
250
|
+
return `${where}[${i}]: ${key} ${pyRepr(t)} is not on any captured screen nor in any page's source texts` +
|
|
251
|
+
(near ? ` (closest known: ${pyRepr(near)})` : '');
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
return null;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
/**
|
|
261
|
+
* Recipe phases blocked on one of their own fixture steps (the tap's control was not on screen)
|
|
262
|
+
* and not yet offered for a revision. Only phases apply registered with their recipe can be
|
|
263
|
+
* rebuilt; an older phase without it stays blocked.
|
|
264
|
+
*/
|
|
265
|
+
export function stepFailedPhases(doc) {
|
|
266
|
+
return get(doc ?? {}, 'phases', []).filter((p) => pyStr(p.id).startsWith('recD-') && p.status === 'blocked' &&
|
|
267
|
+
pyStr(get(p, 'reason', '')).startsWith('fixture-step-failed') && !T(get(p, 'steps_revised')) && isDict(get(p, 'recipe')));
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
/** Recipe phases a revision pass can re-arm: a missed probe, or a fixture step that found no control. */
|
|
271
|
+
export function revisablePhases(doc) { return [...probeFailedPhases(doc), ...stepFailedPhases(doc)]; }
|
|
272
|
+
|
|
273
|
+
/**
|
|
274
|
+
* Each step-failed recipe phase as a `step-revision` item: the recipe's steps, the step that
|
|
275
|
+
* failed, and what the screen showed then (task_runner's `fixture_step_failed` event), so the
|
|
276
|
+
* steps can be rewritten from evidence instead of the phase staying blocked.
|
|
277
|
+
*/
|
|
278
|
+
export function stepFailures(doc, root) {
|
|
279
|
+
const failed = new Map(stepFailedPhases(doc).map((p) => [p.id, p]));
|
|
280
|
+
if (!failed.size) { return []; }
|
|
281
|
+
const last = new Map();
|
|
282
|
+
const evP = pJoin(root, 'events.jsonl');
|
|
283
|
+
if (pIsFile(evP)) {
|
|
284
|
+
for (const line of readText(evP, { encoding: 'utf-8' }).split('\n')) {
|
|
285
|
+
if (!line.includes('"fixture_step_failed"')) { continue; }
|
|
286
|
+
let e; try { e = jsonLoads(line); } catch { continue; }
|
|
287
|
+
const ph = get(get(e, 'payload', {}), 'phase');
|
|
288
|
+
if (get(e, 'kind') === 'fixture_step_failed' && failed.has(ph)) { last.set(ph, e.payload); }
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
// A step of the base replay chain is not the recipe's: rewriting the recipe's steps cannot fix it.
|
|
292
|
+
return [...failed.values()].filter((p) => get(last.get(p.id) ?? {}, 'part') !== 'base').map((p) => {
|
|
293
|
+
const rid = p.id.slice('recD-'.length);
|
|
294
|
+
const key = `sv-${rid}`.length <= 32 ? `sv-${rid}` : `sv-${keyOf(rid)}`;
|
|
295
|
+
const ev = last.get(p.id) ?? {};
|
|
296
|
+
return { key, kind: 'step-revision', phase: p.id, recipe: rid,
|
|
297
|
+
tasks: doc.tasks.filter((t) => t.phase === p.id).map((t) => t.task_id),
|
|
298
|
+
base: get(p.recipe, 'base'), steps: get(p.recipe, 'steps', []), probe_steps: get(p.recipe, 'probe_steps', []),
|
|
299
|
+
failed: get(p, 'reason'), failed_part: get(ev, 'part', null), failed_selector: get(ev, 'selector', null),
|
|
300
|
+
activity: get(ev, 'activity', null), observation_id: get(ev, 'observation_id', null),
|
|
301
|
+
screenshot: T(get(ev, 'observation_id')) ? pJoin(root, 'artifacts', ev.observation_id, 'screen.png') : null,
|
|
302
|
+
visible_texts: get(ev, 'visible_texts', []) };
|
|
303
|
+
});
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
/**
|
|
307
|
+
* The phase fixtures of recipe `r`: restore its base (replay chain or app-data archive), run its
|
|
308
|
+
* steps, save the state it built, relaunch, then its probe steps. Each step carries `recipe_part`
|
|
309
|
+
* (`base` / `steps` / `probe_steps`), so a failed step says whose it is (stepFailures).
|
|
310
|
+
*/
|
|
311
|
+
const tagged = (step, part) => ({ ...toRunner(step), recipe_part: part });
|
|
312
|
+
|
|
313
|
+
function recipeFixtures(r, config) {
|
|
314
|
+
const snapDir = pathStr(config.snapshot_dir);
|
|
315
|
+
const launch = { type: 'launch', component: config.launch_component, restart: true };
|
|
316
|
+
const archive = pJoin(snapDir, outputName(r.base, r.id));
|
|
317
|
+
let restore; let save;
|
|
318
|
+
if (r.base.endsWith(REPLAY)) {
|
|
319
|
+
const chain = get(load(pJoin(snapDir, r.base)), 'steps', []);
|
|
320
|
+
const full = [...chain, ...r.steps];
|
|
321
|
+
restore = [{ type: 'clear_app_data' }, launch, { type: 'wait', seconds: 2 }, ...chain.map((s) => tagged(s, 'base'))];
|
|
322
|
+
save = { type: 'save_replay', archive, steps: full, from: r.base };
|
|
323
|
+
} else {
|
|
324
|
+
restore = [{ type: 'restore_app_data', archive: pJoin(snapDir, r.base),
|
|
325
|
+
clear_dirs: ['databases', 'shared_prefs', 'files'] }, launch, { type: 'wait', seconds: 2 }];
|
|
326
|
+
save = { type: 'snapshot_app_data', archive };
|
|
327
|
+
}
|
|
328
|
+
const fixtures = [...restore, ...r.steps.map((s) => tagged(s, 'steps')),
|
|
329
|
+
{ type: 'wait', seconds: 1 }, save, launch, { type: 'wait', seconds: 2 },
|
|
330
|
+
...or_(get(r, 'probe_steps'), []).map((s) => tagged(s, 'probe_steps'))];
|
|
331
|
+
return [fixtures, archive];
|
|
332
|
+
}
|
|
333
|
+
|
|
94
334
|
/**
|
|
95
335
|
* Worklist of keyed items, one per unreachable B/C item and one per group of phases sharing a
|
|
96
336
|
* requirement signature (one state serves them all), so `worklist_parts.mjs` can split it.
|
|
@@ -140,7 +380,7 @@ export function extract(doc, root, config, unmapped = false) {
|
|
|
140
380
|
it.targets = sortedStr(new Set(it.tasks.map((tid) => pyStr(get(tasks.get(tid) ?? {}, 'target_static')))));
|
|
141
381
|
items.push(it);
|
|
142
382
|
}
|
|
143
|
-
items.push(...probeFailures(doc, root));
|
|
383
|
+
items.push(...probeFailures(doc, root), ...stepFailures(doc, root));
|
|
144
384
|
// Largest groups first: one state unblocks the most tasks.
|
|
145
385
|
const ordered = sortedBy(items, (i) => -i.tasks.length);
|
|
146
386
|
const snapDir = pathStr(get(config, 'snapshot_dir', ''));
|
|
@@ -162,8 +402,16 @@ export function extract(doc, root, config, unmapped = false) {
|
|
|
162
402
|
"a dialog is not. A `probe-revision` item is a recipe whose steps ran but whose probe did not " +
|
|
163
403
|
"match: answer it with verdict 'revise' and new `probes` whose texts are all in its " +
|
|
164
404
|
"`visible_texts` (open its `screenshot`) and that tell the target state apart from the base " +
|
|
165
|
-
"one, or verdict 'skipped' when that screen is not the wanted state."
|
|
405
|
+
"one, or verdict 'skipped' when that screen is not the wanted state. Every text or " +
|
|
406
|
+
'content_desc a step taps must be copied exactly from `screen_texts` (the texts each page ' +
|
|
407
|
+
'showed on the device, then its source texts), from a value the recipe types, or from one of ' +
|
|
408
|
+
'its new fixture files; apply rejects any other. A `step-revision` item is a recipe that ' +
|
|
409
|
+
"stopped on a step whose control was not on screen: answer it with verdict 'revise' and new " +
|
|
410
|
+
'`steps` (optionally `probe_steps`) whose tapped texts are in its `visible_texts` or ' +
|
|
411
|
+
"`screen_texts` (open its `screenshot`), or verdict 'skipped'.",
|
|
166
412
|
count: ordered.length, items: ordered,
|
|
413
|
+
screen_texts: Object.fromEntries([...screenTexts(doc).entries()].sort((a, b) => (a[0] < b[0] ? -1 : a[0] > b[0] ? 1 : 0))
|
|
414
|
+
.map(([sid, list]) => [sid, list.slice(0, SCREEN_TEXTS_PER_PAGE)])),
|
|
167
415
|
snapshots: snapshotNames(snapDir),
|
|
168
416
|
fixture_server_files: feedDir && pIsDir(feedDir) ? sortedStr(listDirNames(feedDir).map((e) => e.name)) : [],
|
|
169
417
|
fixture_feed: feedDir && pIsFile(pJoin(feedDir, 'feed.xml')) ? readText(pJoin(feedDir, 'feed.xml'), { encoding: 'utf-8' }) : null };
|
|
@@ -255,7 +503,7 @@ export function validate(r, doc, config) {
|
|
|
255
503
|
why = checkSteps(ts[tid], MAX_STEPS);
|
|
256
504
|
if (why) { return `${tid}: ${why}`; }
|
|
257
505
|
}
|
|
258
|
-
return
|
|
506
|
+
return groundingProblem(r, knownTexts(doc), [], fixtureServerTexts(config));
|
|
259
507
|
}
|
|
260
508
|
|
|
261
509
|
/**
|
|
@@ -274,11 +522,11 @@ export function apply(doc, config, root) {
|
|
|
274
522
|
const snapDir = pathStr(config.snapshot_dir);
|
|
275
523
|
const feedDir = T(get(config, 'fixture_server_dir')) ? pathStr(config.fixture_server_dir) : null;
|
|
276
524
|
const tasks = new Map(doc.tasks.map((t) => [t.task_id, t]));
|
|
277
|
-
const launch = { type: 'launch', component: config.launch_component, restart: true };
|
|
278
525
|
const report = []; const phases = []; const ids = new Set();
|
|
279
526
|
for (const [key, a] of answerEntries(raw)) {
|
|
280
527
|
const verdict = get(a, 'verdict');
|
|
281
|
-
|
|
528
|
+
const kind = get(items.get(key) ?? {}, 'kind');
|
|
529
|
+
if (key !== null && verdict !== 'recipe' && !(verdict === 'revise' && ['probe-revision', 'step-revision'].includes(kind))) {
|
|
282
530
|
report.push({ key, id: get(a, 'id'), status: 'skipped', why: or_(get(a, 'reason'), pyStr(or_(verdict, 'no verdict'))) });
|
|
283
531
|
continue;
|
|
284
532
|
}
|
|
@@ -296,6 +544,33 @@ export function apply(doc, config, root) {
|
|
|
296
544
|
report.push({ key, id: it.recipe, status: 'revised', tasks: it.tasks.length });
|
|
297
545
|
continue;
|
|
298
546
|
}
|
|
547
|
+
if (key !== null && kind === 'step-revision') {
|
|
548
|
+
const it = items.get(key);
|
|
549
|
+
const ph = doc.phases.find((p) => p.id === it.phase);
|
|
550
|
+
const recipe = ph ? get(ph, 'recipe') : null;
|
|
551
|
+
const revised = isDict(recipe) ? { ...recipe, steps: or_(get(a, 'steps'), []),
|
|
552
|
+
probe_steps: T(get(a, 'probe_steps')) ? a.probe_steps : get(recipe, 'probe_steps') } : null;
|
|
553
|
+
let why = verdict !== 'revise' ? "a step-revision item takes verdict 'revise' or 'skipped'"
|
|
554
|
+
: !ph ? `phase not found: ${pyStr(it.phase)}` : !revised ? 'phase carries no recipe to revise'
|
|
555
|
+
: checkSteps(revised.steps, MAX_SETUP_STEPS);
|
|
556
|
+
if (!why && T(get(revised, 'probe_steps'))) {
|
|
557
|
+
const w = checkSteps(revised.probe_steps, MAX_STEPS);
|
|
558
|
+
if (w) { why = 'probe_steps: ' + w; }
|
|
559
|
+
}
|
|
560
|
+
if (!why) {
|
|
561
|
+
const known = knownTexts(doc);
|
|
562
|
+
for (const t of or_(it.visible_texts, [])) { known.add(normalized(t)); }
|
|
563
|
+
why = groundingProblem(revised, known, [], fixtureServerTexts(config));
|
|
564
|
+
}
|
|
565
|
+
if (why) { report.push({ key, id: it.recipe, status: 'rejected', why }); continue; }
|
|
566
|
+
const [fixtures, archive] = recipeFixtures(revised, config);
|
|
567
|
+
dset(setdefault(config, 'fixtures', {}), ph.id, fixtures);
|
|
568
|
+
Object.assign(ph, { status: 'pending', steps_revised: true, recipe: revised });
|
|
569
|
+
delete ph.reason;
|
|
570
|
+
phases.push(ph.id);
|
|
571
|
+
report.push({ key, id: it.recipe, status: 'revised', tasks: it.tasks.length, archive });
|
|
572
|
+
continue;
|
|
573
|
+
}
|
|
299
574
|
const r = key !== null && !T(get(a, 'tasks')) ? { ...a, tasks: items.get(key).tasks } : a;
|
|
300
575
|
// Re-applying after a later stage failed: the phase is registered (and its snapshot may
|
|
301
576
|
// exist), so keep it scheduled instead of rejecting it or failing on "Phase already exists".
|
|
@@ -312,21 +587,7 @@ export function apply(doc, config, root) {
|
|
|
312
587
|
if (why) { report.push({ ...(key !== null ? { key } : {}), id: get(r, 'id'), status: 'rejected', why }); continue; }
|
|
313
588
|
ids.add(r.id);
|
|
314
589
|
for (const f of get(r, 'fixture_files', [])) { writeText(pJoin(feedDir, f.name), f.content); }
|
|
315
|
-
const archive =
|
|
316
|
-
let restore; let save;
|
|
317
|
-
if (r.base.endsWith(REPLAY)) {
|
|
318
|
-
const chain = get(load(pJoin(snapDir, r.base)), 'steps', []);
|
|
319
|
-
const full = [...chain, ...r.steps];
|
|
320
|
-
restore = [{ type: 'clear_app_data' }, launch, { type: 'wait', seconds: 2 }, ...chain.map(toRunner)];
|
|
321
|
-
save = { type: 'save_replay', archive, steps: full, from: r.base };
|
|
322
|
-
} else {
|
|
323
|
-
restore = [{ type: 'restore_app_data', archive: pJoin(snapDir, r.base),
|
|
324
|
-
clear_dirs: ['databases', 'shared_prefs', 'files'] }, launch, { type: 'wait', seconds: 2 }];
|
|
325
|
-
save = { type: 'snapshot_app_data', archive };
|
|
326
|
-
}
|
|
327
|
-
const fixtures = [...restore, ...r.steps.map(toRunner),
|
|
328
|
-
{ type: 'wait', seconds: 1 }, save, launch, { type: 'wait', seconds: 2 },
|
|
329
|
-
...or_(get(r, 'probe_steps'), []).map(toRunner)];
|
|
590
|
+
const [fixtures, archive] = recipeFixtures(r, config);
|
|
330
591
|
const overrides = {};
|
|
331
592
|
for (const tid of r.tasks) {
|
|
332
593
|
let ov = {};
|
|
@@ -347,6 +608,12 @@ export function apply(doc, config, root) {
|
|
|
347
608
|
basis: [`class-D recipe ${r.id}: ${pyStr(get(r, 'reason', ''))}`], from_phase: 'p0-fresh',
|
|
348
609
|
fixtures, probes: r.probes, cleanup: [{ type: 'wait', seconds: 0.5 }] };
|
|
349
610
|
const n = addVariant(doc, v, config);
|
|
611
|
+
// kept with the phase, so a step that finds no control can be revised and the fixtures rebuilt (stepFailures)
|
|
612
|
+
const added = doc.phases.find((p) => p.id === v.id);
|
|
613
|
+
if (added) {
|
|
614
|
+
added.recipe = { id: r.id, base: r.base, steps: r.steps,
|
|
615
|
+
...(T(get(r, 'probe_steps')) ? { probe_steps: r.probe_steps } : {}) };
|
|
616
|
+
}
|
|
350
617
|
phases.push(v.id);
|
|
351
618
|
report.push({ ...(key !== null ? { key } : {}), id: r.id, status: 'scheduled', tasks: n, archive });
|
|
352
619
|
}
|
|
@@ -18,6 +18,40 @@ import { graph } from './evidence.mjs';
|
|
|
18
18
|
import { readJson, atomicWriteJson } from './utg_explorer/adapters.mjs';
|
|
19
19
|
import { buildCatalog } from './utg_explorer/semantics.mjs';
|
|
20
20
|
import { exportFinal } from './final_utg.mjs';
|
|
21
|
+
import { COLLAPSE_MIN_CASCADE, collapsedPrefixes, collapseNote, presentEntities, seedPlan, seedNote } from './utg_explorer/diagnostics.mjs';
|
|
22
|
+
|
|
23
|
+
/** The static layer's data_model.json next to the campaign's static utg.json, or null. */
|
|
24
|
+
export function loadDataModel(doc) {
|
|
25
|
+
const su = get(doc, 'static_utg');
|
|
26
|
+
if (!truthy(su)) { return null; }
|
|
27
|
+
try { return readJson(pJoin(path.dirname(pyStr(su)), 'data_model.json')); } catch { return null; }
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/** latestTaskResults(events): the events, with each task's task_result kept only at its last occurrence per environment. */
|
|
31
|
+
export function latestTaskResults(events) {
|
|
32
|
+
const last = new Map();
|
|
33
|
+
events.forEach((e, i) => { if (e.kind === 'task_result') { last.set(`${e.environment_id}|${get(e.payload, 'task_id')}`, i); } });
|
|
34
|
+
return events.filter((e, i) => e.kind !== 'task_result' || last.get(`${e.environment_id}|${get(e.payload, 'task_id')}`) === i);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* dataPrerequisites(gaps): the uncovered nodes a missing-data screen blocked (task_runner
|
|
39
|
+
* emptyFailure: `needs-data:<page> (texts)` / `needs-network:`), grouped by that page:
|
|
40
|
+
* [{ kind, page, shown, nodes }]. Test data or a network fixture unblocks them, not a selector review.
|
|
41
|
+
*/
|
|
42
|
+
export function dataPrerequisites(gaps) {
|
|
43
|
+
const by = new Map();
|
|
44
|
+
for (const g of gaps) {
|
|
45
|
+
// Drop the cascade note gapsOf appends, or it lands inside the captured empty-state texts.
|
|
46
|
+
const reason = pyStr(get(g, 'reason', '')).replace(/ \(not run: cascaded from .*\)$/, '');
|
|
47
|
+
const m = /^needs-(data|network):(\S+)(?: \((.*)\))?$/.exec(reason);
|
|
48
|
+
if (!m) { continue; }
|
|
49
|
+
const k = m[1] + '|' + m[2];
|
|
50
|
+
if (!by.has(k)) { by.set(k, { kind: m[1], page: m[2], shown: m[3] ?? '', nodes: [] }); }
|
|
51
|
+
by.get(k).nodes.push(g.id);
|
|
52
|
+
}
|
|
53
|
+
return [...by.values()].sort((a, b) => b.nodes.length - a.nodes.length || a.page.localeCompare(b.page));
|
|
54
|
+
}
|
|
21
55
|
|
|
22
56
|
/** Python str + str (TypeError otherwise). */
|
|
23
57
|
const cat = (...xs) => {
|
|
@@ -77,6 +111,11 @@ export function main(argv = process.argv.slice(2)) {
|
|
|
77
111
|
const labels = new Set([...get(item, 'entry_labels', []), ...get(item, 'titles', [])].filter((t) => truthy(t)));
|
|
78
112
|
const disabled = get(o, 'nodes', []).filter((n) => labels.has(get(n, 'text')) && !truthy(get(n, 'enabled', true))).map((n) => get(n, 'text'));
|
|
79
113
|
if (disabled.length) { reason = 'visible-but-disabled: ' + disabled.join(', '); }
|
|
114
|
+
// Failed without running: another task's prefix failed the same way (task_runner prefix memo).
|
|
115
|
+
if (truthy(get(task, 'prefix_failed_from')) && !disabled.length) {
|
|
116
|
+
reason = `${pyStr(reason)} (not run: cascaded from ${pyStr(task.prefix_failed_from)}`
|
|
117
|
+
+ `${get(task, 'replay_index') !== null && get(task, 'replay_index') !== undefined ? ` at replay step ${pyStr(task.replay_index)}` : ''})`;
|
|
118
|
+
}
|
|
80
119
|
const gap = {};
|
|
81
120
|
for (const k of keysOf(node)) { dset(gap, k, node[k]); }
|
|
82
121
|
gap.reason = reason; gap.basis = get(item, 'basis', []); gap.observation_id = get(task, 'observation_id');
|
|
@@ -118,6 +157,56 @@ export function main(argv = process.argv.slice(2)) {
|
|
|
118
157
|
`Static pages confirmed: ${S(result.mapped_static_nodes)}/${S(result.static_nodes)}; static edges verified: ${S(result.verified_static_edges)}/${S(result.static_edges)}; plus ${S(get(result, 'attested_static_nodes', 0))} attested pages (not counted as confirmed).`,
|
|
119
158
|
`Unique task results: ${S(result.unique_tasks_attempted)}; atomic actions: ${S(result.atomic_actions)}; observations: ${S(result.observations)}.`, '', '## Phases', ''];
|
|
120
159
|
for (const p of result.phases) { lines.push(`- ${S(p.id)}: ${S(p.status)} — ${S(p.reason)}`); }
|
|
160
|
+
// Prefixes the memo reused for many tasks: those phases ran little of themselves, and the gaps
|
|
161
|
+
// they left are an explorer fault to fix before any page review (diagnostics.collapsedPrefixes).
|
|
162
|
+
const tasksById = new Map(get(doc, 'tasks', []).map((t) => [t.task_id, t]));
|
|
163
|
+
// A prefix that failed on an empty page (needs-data / needs-network) is a data prerequisite, listed below.
|
|
164
|
+
// Each task's latest result only: a rerun that ran the tasks a collapse had cut supersedes it.
|
|
165
|
+
// And only the targets still uncovered: a task skipped later because its target got captured left no gap.
|
|
166
|
+
const missingIds = new Set(result.missing_nodes.map((n) => n.id));
|
|
167
|
+
const allCollapses = collapsedPrefixes(latestTaskResults(doc.events), tasksById)
|
|
168
|
+
.map((c) => { const targets = c.targets.filter((t) => missingIds.has(t)); return { ...c, targets, cascaded: targets.length }; })
|
|
169
|
+
.filter((c) => c.cascaded >= COLLAPSE_MIN_CASCADE);
|
|
170
|
+
const collapses = allCollapses.filter((c) => !/^needs-/.test(pyStr(c.reason ?? '')));
|
|
171
|
+
if (collapses.length) {
|
|
172
|
+
lines.push('', '## Collapsed phases (explorer fault, not coverage gaps)', '',
|
|
173
|
+
'One failed replay prefix was reused for the other tasks behind it, which never ran. Fix the step named here first; the pages listed under "Not yet covered" with "not run: cascaded" were never attempted.', '',
|
|
174
|
+
...collapses.map((c) => `- ${S(c.environment_id)}: ${collapseNote(c)}`));
|
|
175
|
+
}
|
|
176
|
+
const prereq = dataPrerequisites(gaps);
|
|
177
|
+
if (prereq.length) {
|
|
178
|
+
lines.push('', '## Data prerequisites', '', 'The path reached a page that showed its empty-state component; these nodes need test data (or, for network, a reachable backend / fixture server), not another selector.', '',
|
|
179
|
+
...prereq.map((d) => `- ${d.page} (${d.kind === 'network' ? 'load failed' : 'empty'}${d.shown ? `: ${d.shown}` : ''}) blocks ${d.nodes.length}: ${d.nodes.join(', ')}`),
|
|
180
|
+
...allCollapses.filter((c) => !collapses.includes(c)).map((c) => `- (${S(c.environment_id)}) ${collapseNote(c)}`));
|
|
181
|
+
}
|
|
182
|
+
// What to seed: the record states the uncovered pages' paths need (a2h-utg-static data_model),
|
|
183
|
+
// as the fewest records that satisfy them all; data_seed_plan.json carries it for a seeding step.
|
|
184
|
+
const model = loadDataModel(doc);
|
|
185
|
+
const nodesById = new Map(get(doc, 'nodes', []).map((n) => [n.id, n]));
|
|
186
|
+
const plan = seedPlan(gaps, nodesById, model, presentEntities(get(result, 'mapped_ids', []), nodesById));
|
|
187
|
+
if (plan.seeds.length || plan.conflicts.length || plan.unseeded.length) {
|
|
188
|
+
const blocked = new Set(prereq.flatMap((d) => d.nodes));
|
|
189
|
+
atomicWriteJson(pJoin(root, 'data_seed_plan.json'), { ...plan, empty_pages: prereq.map((d) => ({ page: d.page, kind: d.kind, shown: d.shown, nodes: d.nodes })),
|
|
190
|
+
sources: Object.fromEntries(Object.entries(get(model || {}, 'entities', {})).map(([e, v]) => [e, get(v, 'sources', [])])) });
|
|
191
|
+
lines.push('', '## Data seed plan', '',
|
|
192
|
+
'Records to create in the test account (or serve) so the uncovered pages below can be reached; each is one record in one state, chosen so the fewest records cover every page. Pages marked * were seen blocked by an empty page in this run. Written to data_seed_plan.json.', '',
|
|
193
|
+
...plan.seeds.map((s) => `- ${seedNote({ ...s, unlocks: s.unlocks.map((u) => (blocked.has(u) ? `${u}*` : u)) })}`),
|
|
194
|
+
...plan.unseeded.map((u) => `- ${u.entity}.${u.field} ${u.op} [${u.values.join(', ')}]: no known value satisfies it; blocks ${u.ids.join(', ')}`),
|
|
195
|
+
...plan.conflicts.map((c) => `- path conflict, ${c.id}: ${c.conflicts.map((x) => `step ${x.earlier.step} needs ${x.entity}.${x.field} ${x.earlier.op} [${x.earlier.values.join(', ')}], step ${x.later.step} needs ${x.later.op} [${x.later.values.join(', ')}] on the same record`).join('; ')} — fix the click-path hint`));
|
|
196
|
+
// Where the app itself creates such a record (a2h-utg-static data_producers): the control and page.
|
|
197
|
+
const makers = Object.entries(get(model || {}, 'entities', {})).filter(([e]) => plan.seeds.some((s) => s.entity === e))
|
|
198
|
+
.flatMap(([e, v]) => get(v, 'producers', []).filter((p) => p.kind === 'create').map((p) => [e, p]));
|
|
199
|
+
if (makers.length) {
|
|
200
|
+
lines.push('', 'In-app producers (a record the app creates in its initial state only; later states come from the backend):', '',
|
|
201
|
+
...makers.map(([e, p]) => `- ${e}: tap 「${S(p.control_text ?? '?')}」 on ${S(p.page ?? '?')} (${S(p.vm_fn ?? '?')}${p.endpoint ? `, ${p.endpoint}` : ''})`
|
|
202
|
+
+ `${truthy(p.checks) ? `; blocked while: ${p.checks.join('; ')}` : ''}`));
|
|
203
|
+
}
|
|
204
|
+
const sources = Object.entries(get(model || {}, 'entities', {})).filter(([e]) => plan.seeds.some((s) => s.entity === e));
|
|
205
|
+
if (sources.length) {
|
|
206
|
+
lines.push('', 'Data layer behind these records (from source):', '',
|
|
207
|
+
...sources.map(([e, v]) => `- ${e}: ${get(v, 'sources', []).map((x) => `${x.name}${x.http ? ` (${x.http})` : ''}`).join(', ') || 'none found'}`));
|
|
208
|
+
}
|
|
209
|
+
}
|
|
121
210
|
const items = (d) => keysOf(d).map((k) => [k, d[k]]);
|
|
122
211
|
const relm = get(result, 'mapped_by_relation', {});
|
|
123
212
|
if (truthy(relm)) {
|
|
@@ -69,8 +69,9 @@ import {
|
|
|
69
69
|
} from './utg_explorer/_py.mjs';
|
|
70
70
|
import { BUSY_WHY } from './device_health.mjs';
|
|
71
71
|
import { scopeOf } from './utg_explorer/coverage.mjs';
|
|
72
|
-
import {
|
|
72
|
+
import { revisablePhases } from './recover_d.mjs';
|
|
73
73
|
import { tarProblem } from './utg_explorer/adapters.mjs';
|
|
74
|
+
import { statePhaseFallbackEnabled } from './utg_explorer/state_phase.mjs';
|
|
74
75
|
|
|
75
76
|
export const HERE = pathStr(path.dirname(fileURLToPath(import.meta.url)));
|
|
76
77
|
export const NODE = process.execPath;
|
|
@@ -180,9 +181,12 @@ export function covered(root) {
|
|
|
180
181
|
return get(a, 'mapped_scope_nodes', get(a, 'mapped_static_nodes', 0));
|
|
181
182
|
}
|
|
182
183
|
|
|
183
|
-
export function budgetFor(doc, phase, perTask) {
|
|
184
|
+
export function budgetFor(doc, phase, perTask, config = null) {
|
|
184
185
|
const n = doc.tasks.filter((t) => t.phase === phase && t.status === 'compiled').length;
|
|
185
|
-
|
|
186
|
+
// A phase's fixtures spend atomic actions before any task runs (a seeding recipe walks a whole
|
|
187
|
+
// checkout: ~70 steps measured on coolmall), twice their step count for searches and waits.
|
|
188
|
+
const fixtures = get(get(config || {}, 'fixtures', {}), phase, []) || [];
|
|
189
|
+
return Math.max(60, n * perTask + 2 * fixtures.length);
|
|
186
190
|
}
|
|
187
191
|
|
|
188
192
|
/** Consecutive failed device phases that end the call (the device is likely gone). */
|
|
@@ -217,7 +221,29 @@ function checkDevice(root, a) {
|
|
|
217
221
|
*/
|
|
218
222
|
export function firstRoundPhases(cfg, doc) {
|
|
219
223
|
const known = new Set((Array.isArray(get(doc, 'phases')) ? doc.phases : []).map((p) => get(p, 'id')));
|
|
220
|
-
|
|
224
|
+
const configured = Object.keys(get(cfg, 'fixtures', {}) || {}).filter((p) => known.has(p));
|
|
225
|
+
// A state phase with no fixture/probe used to be skipped by the first round entirely, so its
|
|
226
|
+
// compiled tasks were never attempted even when the device already held that state. With the
|
|
227
|
+
// best-effort fallback (default only for a uni-app / hybrid app, state_phase.mjs) include those
|
|
228
|
+
// phases after the configured ones; run_device / task_runner verify against the current state
|
|
229
|
+
// and record that no probe was used. A native app keeps them for D and close_phases.
|
|
230
|
+
const out = [...configured];
|
|
231
|
+
if (statePhaseFallbackEnabled(cfg, doc)) {
|
|
232
|
+
const have = new Set(out);
|
|
233
|
+
const fixtures = get(cfg, 'fixtures', {}) || {};
|
|
234
|
+
const probes = get(cfg, 'phase_probes', {}) || {};
|
|
235
|
+
for (const p of (Array.isArray(get(doc, 'phases')) ? doc.phases : [])) {
|
|
236
|
+
const id = get(p, 'id');
|
|
237
|
+
if (!T(id) || have.has(id) || Object.hasOwn(fixtures, id) || Object.hasOwn(probes, id)) { continue; }
|
|
238
|
+
if (!T(get(p, 'requires'))) { continue; }
|
|
239
|
+
if (String(id).startsWith('rec')) { continue; }
|
|
240
|
+
const hasTask = (get(doc, 'tasks', []) || []).some((t) => get(t, 'phase') === id && get(t, 'status') === 'compiled');
|
|
241
|
+
if (!hasTask) { continue; }
|
|
242
|
+
out.push(id);
|
|
243
|
+
have.add(id);
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
return out;
|
|
221
247
|
}
|
|
222
248
|
|
|
223
249
|
/**
|
|
@@ -264,7 +290,7 @@ export function runPhases(root, a, phases, state = null, scope = '') {
|
|
|
264
290
|
checkDevice(root, a); // outside the try: a device that is gone is not one failed phase
|
|
265
291
|
try {
|
|
266
292
|
deps.sh(['run_device.mjs', root, '--config', a.config, '--phase', p, '--tasks',
|
|
267
|
-
'--budget', budgetFor(doc, p, a.budget_per_task)], root, 'run_device.log');
|
|
293
|
+
'--budget', budgetFor(doc, p, a.budget_per_task, (() => { try { return load(a.config); } catch { return null; } })())], root, 'run_device.log');
|
|
268
294
|
err = null;
|
|
269
295
|
break;
|
|
270
296
|
} catch (e) {
|
|
@@ -581,8 +607,12 @@ export function step(root, a, state) {
|
|
|
581
607
|
const cfg = load(a.config, {});
|
|
582
608
|
const snap = get(cfg, 'snapshot_dir');
|
|
583
609
|
if (!T(snap)) {
|
|
610
|
+
// No snapshot_dir means recipes cannot be validated/applied, but the blocked/pending
|
|
611
|
+
// state phases must still be visible to a reviewer instead of disappearing silently.
|
|
612
|
+
try { deps.sh(['recover_d.mjs', 'extract', root, '--config', a.config], root); } catch { /* best effort */ }
|
|
584
613
|
done.push(tag + 'D-extract', tag + 'D');
|
|
585
|
-
setdefault(state, 'skipped', []).push(tag + 'D: config has no snapshot_dir');
|
|
614
|
+
setdefault(state, 'skipped', []).push(tag + 'D: config has no snapshot_dir (state worklist extracted; recipes not applicable)');
|
|
615
|
+
setdefault(state, 'notes', []).push('D: no snapshot_dir; recovery_d_worklist.json lists state phases for review, no recipe was applied');
|
|
586
616
|
} else if (!pGlob(snap, '*').some((p) => pName(p).endsWith('.replay.json')
|
|
587
617
|
|| (pName(p).endsWith('.tar') && tarProblem(pathStr(p)) === null))) {
|
|
588
618
|
const out = deps.sh(['d_prereqs.mjs', 'snapshot', '--config', a.config], root);
|
|
@@ -651,11 +681,13 @@ export function step(root, a, state) {
|
|
|
651
681
|
runPhases(root, a, phasesFile(root, 'recovery_d_phases.txt'), state, tag + 'D');
|
|
652
682
|
deps.sh(['recover_b.mjs', 'adopt', root], root);
|
|
653
683
|
}
|
|
654
|
-
// One
|
|
655
|
-
// with the texts its screen showed
|
|
656
|
-
//
|
|
684
|
+
// One revision pass: a recipe whose steps ran but whose probe missed, or that stopped on a
|
|
685
|
+
// step whose control was not on screen, is offered back with the texts its screen showed
|
|
686
|
+
// (recover_d.mjs probeFailures / stepFailures). Measured (ydweather): both add-city recipes
|
|
687
|
+
// reached Main and blocked on a probe text Main never shows at rest; (coolmall) a login
|
|
688
|
+
// recipe tapped a field hint the screen spelled differently.
|
|
657
689
|
once('D-revise-extract', () => dset(setdefault(state, 'd_revise', {}), tag,
|
|
658
|
-
|
|
690
|
+
revisablePhases(load(pJoin(root, 'campaign.json'), {})).length > 0 &&
|
|
659
691
|
refresh(root, state, 'recovery_d', extractArgs(root, a, 'recovery_d'))));
|
|
660
692
|
if (get(state, 'd_revise', null)?.[tag]) {
|
|
661
693
|
if (gateStage(root, a, state, tag, 'D', overlap)) { return false; }
|
|
@@ -780,6 +812,28 @@ export function rerunFailed(root, a, state) {
|
|
|
780
812
|
const skipType = (s) => new Set(s.split(',').map((x) => pyStrip(x)).filter((x) => x));
|
|
781
813
|
skipType.pyName = '<lambda>';
|
|
782
814
|
|
|
815
|
+
/**
|
|
816
|
+
* T5: a call that stopped only for unanswered review parts left the device idle until the parent
|
|
817
|
+
* ran the cycle again (measured yd-weather: most of the capture stage the device waited). With
|
|
818
|
+
* --follow-min N (the cycle runs as a background job), poll every waiting part's answers file and
|
|
819
|
+
* report true as soon as all are present, so the next pass starts at once; false after N minutes
|
|
820
|
+
* (the call returns as before). capture_pending.json already lists the parts for the parent.
|
|
821
|
+
*/
|
|
822
|
+
export function followAnswers(root, a, state, { sleepMs = (ms) => Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, ms), now = () => Date.now() } = {}) {
|
|
823
|
+
const limit = Number(a.follow_min) * 60_000;
|
|
824
|
+
const parts = (state.waiting ?? []).flatMap((w) => ac_parts(w));
|
|
825
|
+
if (!(limit > 0) || !parts.length) return false;
|
|
826
|
+
progress(root, 'follow-wait', { parts: parts.length, minutes: Number(a.follow_min) });
|
|
827
|
+
const end = now() + limit;
|
|
828
|
+
while (now() < end) {
|
|
829
|
+
if (parts.every((p) => pIsFile(p))) { progress(root, 'follow-ready', { parts: parts.length }); return true; }
|
|
830
|
+
sleepMs(Math.min(15_000, Math.max(0, end - now())));
|
|
831
|
+
}
|
|
832
|
+
progress(root, 'follow-timeout', { parts: parts.length });
|
|
833
|
+
return false;
|
|
834
|
+
}
|
|
835
|
+
const ac_parts = (w) => (Array.isArray(w?.parts) ? w.parts.map((p) => p.answers).filter(Boolean) : []);
|
|
836
|
+
|
|
783
837
|
export function main(argv = process.argv.slice(2)) {
|
|
784
838
|
const ap = new ArgumentParser();
|
|
785
839
|
ap.add_argument('campaign'); ap.add_argument('--config', { required: true }); ap.add_argument('--static', { required: true });
|
|
@@ -791,6 +845,8 @@ export function main(argv = process.argv.slice(2)) {
|
|
|
791
845
|
ap.add_argument('--later-rounds', { default: 'direct', help: 'stages of rounds after the first: direct (default) or all' });
|
|
792
846
|
ap.add_argument('--review', { default: 'overlap', help: 'overlap (default): extract every stage of a round up front, review them all at once; serial: one stage at a time' });
|
|
793
847
|
ap.add_argument('--retry-failed', { action: 'store_true', help: 'run the phases listed in failed_phases again (device / lock failures)' });
|
|
848
|
+
ap.add_argument('--follow-min', { type: Number, default: 0,
|
|
849
|
+
help: 'when a pass stops only for unanswered review parts, poll their answers files this many minutes and run the next pass as soon as they are in (0: return at once, as before)' });
|
|
794
850
|
const a = ap.parse_args(argv);
|
|
795
851
|
if (!['direct', 'all'].includes(a.later_rounds)) { ap.error(`--later-rounds accepts direct and all, got ${pyRepr(a.later_rounds)}`); }
|
|
796
852
|
if (!['overlap', 'serial'].includes(a.review)) { ap.error(`--review accepts overlap and serial, got ${pyRepr(a.review)}`); }
|
|
@@ -836,6 +892,7 @@ export function main(argv = process.argv.slice(2)) {
|
|
|
836
892
|
finished = step(root, a, state);
|
|
837
893
|
save();
|
|
838
894
|
writePending(root, a, state);
|
|
895
|
+
if (finished === false && followAnswers(root, a, state)) { writePending(root, a, state, true); continue; }
|
|
839
896
|
if (finished !== null) { break; }
|
|
840
897
|
writePending(root, a, state, true); // next pass: waiting is reset again
|
|
841
898
|
}
|