@buaa_smat/hometrans 26.0.1 → 26.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -7
- package/agents/code-reviewer.md +25 -138
- package/dist/cli/index.js +4 -1
- package/dist/cli/init.js +131 -26
- package/dist/cli/uninstall.js +5 -5
- package/dist/platform/language.js +77 -0
- package/env-requirements.json +30 -5
- package/i18n/FILE-NAMES.md +9 -0
- package/i18n/agents/code-reviewer.md +364 -0
- package/i18n/agents/model-render-worker.md +38 -0
- package/i18n/agents/specgen-worker.md +18 -0
- package/i18n/commands/hometrans.md +17 -0
- package/i18n/skills/a2h-app-migrate/SKILL.md +198 -0
- package/i18n/skills/a2h-app-migrate/references/config.example.json +28 -0
- package/i18n/skills/a2h-app-migrate/references/specs.example.json +19 -0
- package/i18n/skills/a2h-app-migrate/references/stage-map.md +50 -0
- package/i18n/skills/a2h-app-migrate/references/workflow.yaml +1760 -0
- package/i18n/skills/a2h-app-migrate/scripts/check_spec_gen_done.mjs +114 -0
- package/i18n/skills/a2h-app-migrate/scripts/env_preflight.mjs +1588 -0
- package/i18n/skills/a2h-app-migrate/scripts/human_review_gate.mjs +657 -0
- package/i18n/skills/a2h-app-migrate/scripts/validate_workflow.mjs +541 -0
- package/i18n/skills/a2h-app-migrate/test/test_android_index.mjs +131 -0
- package/i18n/skills/a2h-app-migrate/test/test_arch_done.mjs +54 -0
- package/i18n/skills/a2h-app-migrate/test/test_build_fixer_contract.mjs +98 -0
- package/i18n/skills/a2h-app-migrate/test/test_config_example.mjs +42 -0
- package/i18n/skills/a2h-app-migrate/test/test_ensure_utg_snapshot.mjs +147 -0
- package/i18n/skills/a2h-app-migrate/test/test_env_requirements.mjs +698 -0
- package/i18n/skills/a2h-app-migrate/test/test_finalize.mjs +89 -0
- package/i18n/skills/a2h-app-migrate/test/test_image_probe.mjs +120 -0
- package/i18n/skills/a2h-app-migrate/test/test_interaction.mjs +122 -0
- package/i18n/skills/a2h-app-migrate/test/test_preflight_report.mjs +93 -0
- package/i18n/skills/a2h-app-migrate/test/test_resume_plan.mjs +219 -0
- package/i18n/skills/a2h-app-migrate/test/test_resume_summary.mjs +196 -0
- package/i18n/skills/a2h-app-migrate/test/test_reuse_static_utg.mjs +100 -0
- package/i18n/skills/a2h-app-migrate/test/test_run_dir.mjs +488 -0
- package/i18n/skills/a2h-app-migrate/test/test_skill_doc.mjs +144 -0
- package/i18n/skills/a2h-app-migrate/test/test_spec_gen_done.mjs +146 -0
- package/i18n/skills/a2h-app-migrate/test/test_spec_gen_gate.mjs +161 -0
- package/i18n/skills/a2h-app-migrate/test/test_specs_json_preflight.mjs +76 -0
- package/i18n/skills/a2h-app-migrate/test/test_ui_batch_gate.mjs +226 -0
- package/i18n/skills/a2h-app-migrate/test/test_user_facing_progress.mjs +43 -0
- package/i18n/skills/a2h-app-migrate/test/test_utg_static_done.mjs +171 -0
- package/i18n/skills/a2h-app-migrate/test/test_validate_workflow_bilingual.mjs +87 -0
- package/i18n/skills/a2h-arch-generate/SKILL.md +375 -0
- package/i18n/skills/a2h-arch-generate/examples/reconcile-existing-project.md +107 -0
- package/i18n/skills/a2h-arch-generate/examples/simple-conversion-backend.md +70 -0
- package/i18n/skills/a2h-arch-generate/references/arkts-mvvm-v2.md +1407 -0
- package/i18n/skills/a2h-arch-generate/references/artifact-contracts.generate.md +120 -0
- package/i18n/skills/a2h-arch-generate/references/artifact-contracts.reconcile.md +123 -0
- package/i18n/skills/a2h-arch-generate/references/bpta-layered-architecture-design.md +88 -0
- package/i18n/skills/a2h-arch-generate/references/database-schema-recovery.md +107 -0
- package/i18n/skills/a2h-arch-generate/references/existing-target-annotation.md +68 -0
- package/i18n/skills/a2h-arch-generate/references/harmony-project-inspection.md +150 -0
- package/i18n/skills/a2h-arch-generate/references/harmony-target-architecture.md +94 -0
- package/i18n/skills/a2h-arch-generate/references/homegraph-workflow.md +120 -0
- package/i18n/skills/a2h-arch-generate/references/source-baseline.md +93 -0
- package/i18n/skills/a2h-arch-generate/scripts/generate_source_baseline.mjs +360 -0
- package/i18n/skills/a2h-arch-generate/scripts/inspect_harmony_target.mjs +798 -0
- package/i18n/skills/a2h-arch-generate/scripts/lib/contract_terms.mjs +40 -0
- package/i18n/skills/a2h-arch-generate/scripts/module_create/generate.mjs +639 -0
- package/i18n/skills/a2h-arch-generate/scripts/module_create/testdata/reconcile-layer-PROJECT_DESIGN.md +47 -0
- package/i18n/skills/a2h-arch-generate/scripts/module_create/testdata/single-entry-PROJECT_DESIGN.md +15 -0
- package/i18n/skills/a2h-arch-generate/scripts/module_create/testdata/three-layer-PROJECT_DESIGN.md +36 -0
- package/i18n/skills/a2h-arch-generate/scripts/module_create/testdata/verification-report.md +150 -0
- package/i18n/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/uniapp_source/pages.json +5 -0
- package/i18n/skills/a2h-arch-generate/scripts/tests/e2e/run_e2e.mjs +548 -0
- package/i18n/skills/a2h-arch-generate/scripts/tests/run_tests.mjs +1261 -0
- package/i18n/skills/a2h-arch-generate/scripts/tests/test_module_templates.mjs +70 -0
- package/i18n/skills/a2h-arch-generate/scripts/validate_architecture_docs.mjs +851 -0
- package/i18n/skills/a2h-arch-generate/scripts/validate_data_docs.mjs +982 -0
- package/i18n/skills/a2h-arkts-logic-coder/references/ISSUES.md +9 -0
- package/i18n/skills/a2h-arkts-logic-coder/references/code-generation.md +192 -0
- package/i18n/skills/a2h-arkts-logic-coder/references/spec-design.md +303 -0
- package/i18n/skills/a2h-arkts-logic-coder/scripts/design/move_spec_technical_reference.mjs +162 -0
- package/i18n/skills/a2h-arkts-logic-coder/scripts/design/validate_spec_design_output.mjs +298 -0
- package/i18n/skills/a2h-arkts-logic-coder/scripts/state_doc.mjs +587 -0
- package/i18n/skills/a2h-arkts-logic-coder/scripts/test_check_units.ts +149 -0
- package/i18n/skills/a2h-arkts-logic-coder/test/golden/move_design.md +18 -0
- package/i18n/skills/a2h-arkts-logic-coder/test/golden/move_design_crlf.md +18 -0
- package/i18n/skills/a2h-arkts-logic-coder/test/golden/move_spec.md +7 -0
- package/i18n/skills/a2h-arkts-logic-coder/test/golden/validate_issue_file.md +12 -0
- package/i18n/skills/a2h-arkts-logic-coder/test/golden/validate_issues.json +57 -0
- package/i18n/skills/a2h-arkts-logic-coder/test/test_spec_design_scripts.mjs +547 -0
- package/i18n/skills/a2h-arkts-logic-coder/test/test_state_doc.mjs +352 -0
- package/i18n/skills/a2h-batch-ui-align/SKILL.md +323 -0
- package/i18n/skills/a2h-batch-ui-align/references/cards/alignment.md +31 -0
- package/i18n/skills/a2h-batch-ui-align/references/cards/build.md +13 -0
- package/i18n/skills/a2h-batch-ui-align/references/cards/canvas.md +17 -0
- package/i18n/skills/a2h-batch-ui-align/references/cards/dynamics.md +27 -0
- package/i18n/skills/a2h-batch-ui-align/references/cards/geometry.md +80 -0
- package/i18n/skills/a2h-batch-ui-align/references/cards/interaction.md +22 -0
- package/i18n/skills/a2h-batch-ui-align/references/cards/resources.md +87 -0
- package/i18n/skills/a2h-batch-ui-align/references/cards/state-v1.md +29 -0
- package/i18n/skills/a2h-batch-ui-align/references/cards/state.md +14 -0
- package/i18n/skills/a2h-batch-ui-align/references/cards/widgets.md +57 -0
- package/i18n/skills/a2h-batch-ui-align/references/cards/window.md +29 -0
- package/i18n/skills/a2h-batch-ui-align/references/checker-rules.md +705 -0
- package/i18n/skills/a2h-batch-ui-align/references/conversion-procedure.md +417 -0
- package/i18n/skills/a2h-batch-ui-align/references/incremental-scope.md +139 -0
- package/i18n/skills/a2h-batch-ui-align/references/lottie-integration.md +43 -0
- package/i18n/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-atomic-component-mapping-reference.md +2549 -0
- package/i18n/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-interaction-mapping-reference.md +560 -0
- package/i18n/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-layout-mapping-reference.md +148 -0
- package/i18n/skills/a2h-batch-ui-align/references/state-mgmt/_decorator-quickref.md +220 -0
- package/i18n/skills/a2h-batch-ui-align/references/state-mgmt/_paradigm-selection.md +28 -0
- package/i18n/skills/a2h-batch-ui-align/references/step3-capture.md +216 -0
- package/i18n/skills/a2h-batch-ui-align/references/step4-prepare.md +203 -0
- package/i18n/skills/a2h-batch-ui-align/references/step5-convert.md +210 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/android_parse_fast.ts +2005 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/build_conversion_set.mjs +1748 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/databinding_analyzer_design.md +79 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/detect_paradigm.mjs +245 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/draw_coverage.mjs +264 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/export_ui_info.mjs +1787 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/gen_rule_docs.mjs +100 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/generate_pages_json.mjs +612 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/group_pack.mjs +1836 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/image_probe.mjs +405 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/measure_pack.ts +1406 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/phase5_check.mjs +1226 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/shell_contract.mjs +1220 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/state_doc.mjs +412 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/core/cli.ts +134 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/core/i18n.ts +18 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/main.ts +173 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/a11y.ts +629 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/android_immersive.ts +125 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/attr_chain.ts +67 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/block_comment_break.ts +64 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/blur_mirrored.ts +134 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/builder_call_sites.ts +242 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/builder_invokes_callback.ts +136 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/canvas.ts +255 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/color_string.ts +109 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/column_shrink.ts +154 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/constant_coordinate.ts +39 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/container_align.ts +140 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/entry_root_builtin.ts +69 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/entry_route.ts +114 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/fixed_size_safe_area.ts +103 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/format_string.ts +157 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/framework_dialog.ts +110 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/framework_picker.ts +115 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/layout_placement.ts +551 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/media_content.ts +138 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/media_tint.ts +374 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/offset_in_scroll.ts +163 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/orphan_component.ts +119 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/padding_in_size.ts +119 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/page_reachability.ts +94 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/path_commands_vp.ts +50 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/percent_height_in_scroll.ts +80 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/popup_menu.ts +137 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/r_template_string.ts +37 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/request_permission.ts +98 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/resource_as_string.ts +68 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/root_weight.ts +97 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/safe_area_clipping.ts +168 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/scroll_align.ts +75 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/scroll_delta.ts +178 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/sdk_api.ts +195 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/shared_chrome.ts +73 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/sheet_blur.ts +95 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/shell_content.ts +198 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/stack_occluding.ts +118 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/state_decorators.ts +73 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/state_name_shadows.ts +93 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/string_quote_leak.ts +73 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/surface_stroke.ts +50 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/theme_color.ts +123 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/track_getter.ts +132 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/wide_constant_width.ts +53 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/window_mode.ts +67 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_a11y.test.mjs +598 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_blur.test.mjs +217 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_builder_calls.test.mjs +323 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_fidelity.test.mjs +507 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_layout_placement.test.mjs +427 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_occlusion_offset_format.test.mjs +372 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_review_fixes.test.mjs +298 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_rules.test.mjs +365 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_scroll_padding_raster.test.mjs +262 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_weight_color.test.mjs +473 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/build_conversion_set.test.mjs +560 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/draw_coverage.test.mjs +245 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/export_ui_info.test.mjs +742 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/generate_pages_json.test.mjs +123 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/group_pack.test.mjs +363 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/image_probe.test.mjs +243 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/measure_pack.test.mjs +324 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/occlusion.test.mjs +102 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/phase5_check.test.mjs +325 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/skill_doc_contract.test.mjs +48 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/state_doc.test.mjs +387 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/static_check_registry.test.mjs +122 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/text_color_diff.test.mjs +250 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/text_color_diff.mjs +470 -0
- package/i18n/skills/a2h-coldstart-smoke-gate/SKILL.md +59 -0
- package/i18n/skills/a2h-dashboard-render/SKILL.md +73 -0
- package/i18n/skills/a2h-dashboard-render/references/artifact-contract.jsonc +117 -0
- package/i18n/skills/a2h-dashboard-render/references/artifact-registry-spec.md +67 -0
- package/i18n/skills/a2h-dashboard-render/references/dashboard-guide.md +91 -0
- package/i18n/skills/a2h-dashboard-render/references/dashboard.config.example.json +19 -0
- package/i18n/skills/a2h-dashboard-render/scripts/dashboard.mjs +3245 -0
- package/i18n/skills/a2h-dashboard-render/scripts/device_capture.mjs +2048 -0
- package/i18n/skills/a2h-dashboard-render/test/fixtures/page_capture/expected.json +156 -0
- package/i18n/skills/a2h-dashboard-render/test/fixtures/page_capture/hmos.json +1 -0
- package/i18n/skills/a2h-dashboard-render/test/fixtures/page_capture/list.xml +1 -0
- package/i18n/skills/a2h-dashboard-render/test/test_artifact_contract.mjs +168 -0
- package/i18n/skills/a2h-dashboard-render/test/test_dashboard_architecture.mjs +118 -0
- package/i18n/skills/a2h-dashboard-render/test/test_dashboard_build.mjs +93 -0
- package/i18n/skills/a2h-dashboard-render/test/test_dashboard_i18n.mjs +154 -0
- package/i18n/skills/a2h-dashboard-render/test/test_dashboard_node.mjs +1369 -0
- package/i18n/skills/a2h-dashboard-render/test/test_dashboard_spec_pipeline.mjs +318 -0
- package/i18n/skills/a2h-dashboard-render/test/test_dashboard_ui_pipeline.mjs +81 -0
- package/i18n/skills/a2h-dashboard-render/test/test_device_capture_env.mjs +115 -0
- package/i18n/skills/a2h-dashboard-render/test/test_device_capture_policy.mjs +411 -0
- package/i18n/skills/a2h-dashboard-render/test/test_page_capture.mjs +147 -0
- package/i18n/skills/a2h-dashboard-render/test/test_usage_readers.mjs +512 -0
- package/i18n/skills/a2h-fix-build-errors/SKILL.md +304 -0
- package/i18n/skills/a2h-fix-build-errors/references/arkts-strict-patterns.md +219 -0
- package/i18n/skills/a2h-fix-build-errors/references/rdb-entity-pattern.md +131 -0
- package/i18n/skills/a2h-module-semantic-docs/SKILL.md +227 -0
- package/i18n/skills/a2h-module-semantic-docs/test/golden/module_structure.json +187 -0
- package/i18n/skills/a2h-module-semantic-docs/test/golden/module_understanding.json +351 -0
- package/i18n/skills/a2h-module-semantic-docs/test/golden/module_update_plan.json +495 -0
- package/i18n/skills/a2h-module-semantic-docs/test/golden/project_directory_structure.json +157 -0
- package/i18n/skills/a2h-module-semantic-docs/test/test_scan_and_commit.mjs +388 -0
- package/i18n/skills/a2h-page-specgen/SKILL.md +136 -0
- package/i18n/skills/a2h-page-specgen/references/body-language.md +177 -0
- package/i18n/skills/a2h-page-specgen/references/gates.md +262 -0
- package/i18n/skills/a2h-page-specgen/references/page-inventory.md +173 -0
- package/i18n/skills/a2h-page-specgen/references/spec-template.md +207 -0
- package/i18n/skills/a2h-page-specgen/scripts/facts-build.mjs +1504 -0
- package/i18n/skills/a2h-page-specgen/scripts/footprint.mjs +1528 -0
- package/i18n/skills/a2h-page-specgen/scripts/gate.mjs +576 -0
- package/i18n/skills/a2h-page-specgen/scripts/interactions.mjs +138 -0
- package/i18n/skills/a2h-page-specgen/scripts/lib/contracts.mjs +262 -0
- package/i18n/skills/a2h-page-specgen/scripts/lib/hg.mjs +176 -0
- package/i18n/skills/a2h-page-specgen/scripts/lib/prose.mjs +248 -0
- package/i18n/skills/a2h-page-specgen/scripts/lib/reach.mjs +53 -0
- package/i18n/skills/a2h-page-specgen/scripts/prepare.mjs +506 -0
- package/i18n/skills/a2h-page-specgen/scripts/render.mjs +299 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/acceptance.mjs +616 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/contracts.test.mjs +234 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/facts.test.mjs +1166 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/finalize.test.mjs +74 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/facts/i18n/zh.js.txt +8 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/facts/res/values-b+zh+Hans/strings.xml +7 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/facts/res/values-zh/strings.xml +8 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/utg/click_paths.json +28 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/footprint-resolve.test.mjs +758 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/fsx.test.mjs +32 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/gate-partial.test.mjs +54 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/gate.test.mjs +271 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/helpers.mjs +54 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/hg.test.mjs +171 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/integration.test.mjs +301 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/interactions.test.mjs +83 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/inventory.test.mjs +139 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/keys.test.mjs +774 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/plan-build.test.mjs +1011 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/prompt-tpl.test.mjs +77 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/prose.test.mjs +419 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/reach.test.mjs +93 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/recovery-e2e.test.mjs +323 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/recovery.test.mjs +546 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/render.test.mjs +511 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/submit.test.mjs +701 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/utg-io.test.mjs +90 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/waker-process.test.mjs +1765 -0
- package/i18n/skills/a2h-resource-convert/SKILL.md +367 -0
- package/i18n/skills/a2h-resource-convert/references/code-vector-icon-rules.md +335 -0
- package/i18n/skills/a2h-resource-convert/references/incremental-page-migration.md +251 -0
- package/i18n/skills/a2h-resource-convert/references/lottie-conversion-rules.md +219 -0
- package/i18n/skills/a2h-resource-convert/references/resource-mapping-rules.md +493 -0
- package/i18n/skills/a2h-resource-convert/references/step4-resource-types.md +249 -0
- package/i18n/skills/a2h-resource-convert/references/step7-report-template.md +217 -0
- package/i18n/skills/a2h-resource-convert/scripts/a2h_resource_convert.ts +2532 -0
- package/i18n/skills/a2h-resource-convert/scripts/tests/docs_only_i18n.test.mjs +44 -0
- package/i18n/skills/a2h-spec-design-pipeline/SKILL.md +278 -0
- package/i18n/skills/a2h-spec-design-pipeline/references/coding-loop.md +260 -0
- package/i18n/skills/a2h-spec-design-pipeline/references/merge-queue.md +163 -0
- package/i18n/skills/a2h-spec-design-pipeline/references/scripts.md +44 -0
- package/i18n/skills/a2h-spec-design-pipeline/references/specs.example.json +19 -0
- package/i18n/skills/a2h-spec-design-pipeline/scripts/plan_groups.ts +589 -0
- package/i18n/skills/a2h-spec-design-pipeline/scripts/test_plan_groups.ts +506 -0
- package/i18n/skills/a2h-spec-generate/SKILL.md +375 -0
- package/i18n/skills/a2h-spec-generate/references/batch-mode.md +215 -0
- package/i18n/skills/a2h-spec-generate/references/delete-blast-radius.md +3 -0
- package/i18n/skills/a2h-spec-generate/references/dispatch-watchdog.md +150 -0
- package/i18n/skills/a2h-spec-generate/references/fusion-task-contract.md +184 -0
- package/i18n/skills/a2h-spec-generate/references/input-formats.md +27 -0
- package/i18n/skills/a2h-spec-generate/references/library-evidence.md +3 -0
- package/i18n/skills/a2h-spec-generate/references/method-discipline.md +64 -0
- package/i18n/skills/a2h-spec-generate/references/optional-gates.json +45 -0
- package/i18n/skills/a2h-spec-generate/references/recall-guide.md +84 -0
- package/i18n/skills/a2h-spec-generate/references/recall-terse.md +3 -0
- package/i18n/skills/a2h-spec-generate/references/recall-uniapp.md +10 -0
- package/i18n/skills/a2h-spec-generate/references/requirement-scope.md +122 -0
- package/i18n/skills/a2h-spec-generate/references/review-checklist.md +22 -0
- package/i18n/skills/a2h-spec-generate/references/spec-sample-complex.md +80 -0
- package/i18n/skills/a2h-spec-generate/references/spec-sample-transfer.md +43 -0
- package/i18n/skills/a2h-spec-generate/references/spec-samples.md +65 -0
- package/i18n/skills/a2h-spec-generate/references/specs.schema.json +85 -0
- package/i18n/skills/a2h-spec-generate/references/synthesis-rules.md +145 -0
- package/i18n/skills/a2h-spec-generate/references/transfer-file.md +5 -0
- package/i18n/skills/a2h-spec-generate/references/transfer-socket.md +5 -0
- package/i18n/skills/a2h-spec-generate/references/worker-rules.md +129 -0
- package/i18n/skills/a2h-spec-generate/scripts/check-fused-spec.mjs +702 -0
- package/i18n/skills/a2h-spec-generate/scripts/check_spec.ts +515 -0
- package/i18n/skills/a2h-spec-generate/scripts/collect-specs.mjs +727 -0
- package/i18n/skills/a2h-spec-generate/scripts/feature-stem.mjs +151 -0
- package/i18n/skills/a2h-spec-generate/scripts/parse_requirements.ts +515 -0
- package/i18n/skills/a2h-spec-generate/scripts/prepare-facts.mjs +313 -0
- package/i18n/skills/a2h-spec-generate/scripts/publish-specs.mjs +354 -0
- package/i18n/skills/a2h-spec-generate/scripts/regroup-by-page.mjs +669 -0
- package/i18n/skills/a2h-spec-generate/scripts/render-tasks.mjs +385 -0
- package/i18n/skills/a2h-spec-generate/scripts/report.mjs +136 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/analysis/graph/build.ts +2217 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/analysis/graph/component-variants.ts +845 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/analysis/names/policy.ts +572 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/analysis/names/traceability.ts +580 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/analysis/req-model/build.ts +1265 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/fusion/area-facts.ts +1057 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/fusion/behavior-seed.ts +565 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/fusion/library-evidence.ts +544 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/fusion/navigation-guard.ts +363 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/fusion/schema.ts +317 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/fusion/selfcheck.ts +707 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/fusion/spec-bindings.ts +436 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/fusion/task-contract.ts +608 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/interaction-analysis/contracts.ts +650 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/interaction-analysis/task-contract.ts +178 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/interaction-analysis/tree-sitter-adapter.ts +923 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/model/finalize.ts +912 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/model/task.ts +279 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/requirement-scope.ts +163 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/source-index/homegraph.ts +1039 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/src/validation/req-text.ts +256 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/fixtures/fusion-run.ts +243 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/fusion-area-facts.test.ts +576 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/fusion-behavior-detectors.test.ts +176 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/fusion-behavior-e2e.test.ts +103 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/fusion-behavior-schema.test.ts +111 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/fusion-behavior-selfcheck.test.ts +307 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/fusion-contract.test.ts +340 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/fusion-finalize.test.ts +1857 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/fusion-navigation-guard.test.ts +262 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/fusion-prepare.test.ts +722 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/fusion-scope.test.ts +339 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/fusion-selfcheck.test.ts +1253 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/fusion-spec.test.ts +608 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/model-scope.test.ts +411 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/model-task-contract.test.ts +300 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/model-v4.test.ts +1061 -0
- package/i18n/skills/a2h-spec-generate/scripts/reqgen/test/uniapp-scanner.test.ts +159 -0
- package/i18n/skills/a2h-spec-generate/template/REQ.txt +22 -0
- package/i18n/skills/a2h-spec-generate/template/REQ.xlsx +0 -0
- package/i18n/skills/a2h-spec-generate/test/check-fused-spec.test.mjs +847 -0
- package/i18n/skills/a2h-spec-generate/test/check-spec.test.ts +415 -0
- package/i18n/skills/a2h-spec-generate/test/collect-specs.test.mjs +808 -0
- package/i18n/skills/a2h-spec-generate/test/feature-stem.test.mjs +157 -0
- package/i18n/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/components/MyCard.vue +9 -0
- package/i18n/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/feature/editor/index.vue +1 -0
- package/i18n/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/pages/detail/index.vue +1 -0
- package/i18n/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/pages/home/index.vue +33 -0
- package/i18n/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/pages/settings/index.vue +1 -0
- package/i18n/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/pages.json +23 -0
- package/i18n/skills/a2h-spec-generate/test/inspect-uniapp.test.mjs +54 -0
- package/i18n/skills/a2h-spec-generate/test/prepare-facts.test.mjs +41 -0
- package/i18n/skills/a2h-spec-generate/test/publish-specs.test.mjs +295 -0
- package/i18n/skills/a2h-spec-generate/test/regroup-by-page.test.mjs +354 -0
- package/i18n/skills/a2h-spec-generate/test/render-tasks.test.mjs +596 -0
- package/i18n/skills/a2h-spec-generate/test/report.test.mjs +47 -0
- package/i18n/skills/a2h-utg-explorer/SKILL.md +120 -0
- package/i18n/skills/a2h-utg-explorer/references/architecture.md +279 -0
- package/i18n/skills/a2h-utg-explorer/scripts/compile_tasks.mjs +918 -0
- package/i18n/skills/a2h-utg-explorer/scripts/final_utg.mjs +446 -0
- package/i18n/skills/a2h-utg-explorer/scripts/hint_check.mjs +147 -0
- package/i18n/skills/a2h-utg-explorer/scripts/hint_source.mjs +119 -0
- package/i18n/skills/a2h-utg-explorer/scripts/recover_b.mjs +550 -0
- package/i18n/skills/a2h-utg-explorer/scripts/recover_d.mjs +380 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/attest.test.mjs +66 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/compose_identity.test.mjs +302 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/content_wait.test.mjs +207 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/direct_launch.test.mjs +130 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/final_utg.test.mjs +135 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/generalization_fixes.test.mjs +252 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/hint_check.test.mjs +129 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/interruptions.test.mjs +492 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/launch_bridge.test.mjs +199 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/overflow_prefix.test.mjs +327 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/overlay_identity.test.mjs +204 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/page_identity_tiers.test.mjs +393 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/pager_navigation.test.mjs +119 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/panel_routes.test.mjs +208 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/pipeline.test.mjs +240 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/recover_b.test.mjs +173 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/recover_d.test.mjs +280 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/robustness_fixes.test.mjs +345 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/runner_capabilities.test.mjs +194 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/semantics.test.mjs +102 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/state_ambiguity.test.mjs +92 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/twin_opener.test.mjs +119 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/variant_strings.test.mjs +63 -0
- package/i18n/skills/a2h-utg-explorer/scripts/utg_explorer/semantics.mjs +1412 -0
- package/i18n/skills/a2h-utg-explorer/scripts/utg_explorer/task_runner.mjs +2037 -0
- package/i18n/skills/a2h-utg-static/SKILL.md +368 -0
- package/i18n/skills/a2h-utg-static/references/ui-elements-static-utg-schema.md +248 -0
- package/i18n/skills/a2h-utg-static/references/view-interactions.md +215 -0
- package/i18n/skills/a2h-utg-static/scripts/assemble.mjs +2120 -0
- package/i18n/skills/a2h-utg-static/scripts/audit.mjs +268 -0
- package/i18n/skills/a2h-utg-static/scripts/click_paths.mjs +609 -0
- package/i18n/skills/a2h-utg-static/scripts/compose_body_text.mjs +250 -0
- package/i18n/skills/a2h-utg-static/scripts/compose_titles.mjs +374 -0
- package/i18n/skills/a2h-utg-static/scripts/compose_widgets.mjs +498 -0
- package/i18n/skills/a2h-utg-static/scripts/fragment_nav.mjs +1137 -0
- package/i18n/skills/a2h-utg-static/scripts/hybrid_scope.mjs +660 -0
- package/i18n/skills/a2h-utg-static/scripts/interaction_sites.mjs +267 -0
- package/i18n/skills/a2h-utg-static/scripts/label_resolve.mjs +913 -0
- package/i18n/skills/a2h-utg-static/scripts/nl_hints.mjs +517 -0
- package/i18n/skills/a2h-utg-static/scripts/presenter_nav.mjs +490 -0
- package/i18n/skills/a2h-utg-static/scripts/static_prior.mjs +956 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/regression_matrix.mjs +1261 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_callee_string_default.mjs +30 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_chrome_tokens.mjs +60 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_commented_out_trigger.mjs +111 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_compose_res_text.mjs +108 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_compose_vm_nav.mjs +289 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_disabled_guard.mjs +42 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_drawer_panel_gesture.mjs +140 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_fresh_branch_guard.mjs +49 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_hint_language.mjs +136 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_hybrid_bundle_attribution.mjs +74 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_hybrid_bundled_pages.mjs +181 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_hybrid_scope.mjs +293 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_hybrid_title_renders.mjs +118 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_label_accessor_forms.mjs +187 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_label_source.mjs +70 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_launch_intent_guard.mjs +67 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_login_interceptor.mjs +368 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_mode_and_cb_param.mjs +172 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_module_strings.mjs +44 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_nl_hint_grammar.mjs +42 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_nl_hints_gate.mjs +85 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_nl_hints_off_path.mjs +67 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_non_gesture_step_flag.mjs +62 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_preference_widgets.mjs +48 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_read_text_crlf.mjs +41 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_sealed_dialog_state.mjs +148 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_state_specific_hop.mjs +130 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_synthetic_label_identity.mjs +51 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_template_title.mjs +61 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_ui_elements_flow_filter.mjs +110 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_uniapp_data_table.mjs +340 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_uniapp_relative_url.mjs +125 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_uniapp_source.mjs +231 -0
- package/i18n/skills/a2h-utg-static/scripts/tests/test_viewpage_nav.mjs +340 -0
- package/i18n/skills/a2h-utg-static/scripts/uniapp_nav.mjs +1351 -0
- package/i18n/skills/a2h-utg-static/scripts/uniapp_widgets.mjs +244 -0
- package/i18n/skills/a2h-utg-static/tools/convert_static_utg_to_ui_elements.ts +769 -0
- package/package.json +13 -160
- package/platforms/deveco/agents/code-reviewer.frontmatter.md +1 -1
- package/platforms/opencode/agents/code-reviewer.frontmatter.md +1 -1
- package/skills/a2h-app-migrate/SKILL.md +17 -6
- package/skills/a2h-app-migrate/references/config.example.json +1 -0
- package/skills/a2h-app-migrate/references/stage-map.md +3 -1
- package/skills/a2h-app-migrate/references/workflow.yaml +138 -47
- package/skills/a2h-app-migrate/scripts/check_spec_gen_done.mjs +1 -2
- package/skills/a2h-app-migrate/scripts/env_preflight.mjs +105 -39
- package/skills/a2h-app-migrate/scripts/human_review_gate.mjs +7 -8
- package/skills/a2h-app-migrate/scripts/ledger.mjs +17 -5
- package/skills/a2h-app-migrate/scripts/resume_plan.mjs +43 -7
- package/skills/a2h-app-migrate/scripts/run_dir.mjs +127 -41
- package/skills/a2h-app-migrate/scripts/spec_layout.mjs +2 -0
- package/skills/a2h-app-migrate/scripts/validate_workflow.mjs +38 -0
- package/skills/a2h-app-migrate/test/test_android_index.mjs +131 -0
- package/skills/a2h-app-migrate/test/test_apk_preflight.mjs +63 -0
- package/skills/a2h-app-migrate/test/test_arch_done.mjs +54 -0
- package/skills/a2h-app-migrate/test/test_build_fixer_contract.mjs +98 -0
- package/skills/a2h-app-migrate/test/test_config_example.mjs +42 -0
- package/skills/a2h-app-migrate/test/test_devecocli_docs_preflight.mjs +32 -0
- package/skills/a2h-app-migrate/test/test_ensure_utg_snapshot.mjs +147 -0
- package/skills/a2h-app-migrate/test/test_entry_guards.mjs +102 -0
- package/skills/a2h-app-migrate/test/test_env_requirements.mjs +698 -0
- package/skills/a2h-app-migrate/test/test_finalize.mjs +89 -0
- package/skills/a2h-app-migrate/test/test_gate_checkpoint.mjs +146 -0
- package/skills/a2h-app-migrate/test/test_hmos_fingerprint.mjs +68 -0
- package/skills/a2h-app-migrate/test/test_i18n_engine_mirror.mjs +51 -0
- package/skills/a2h-app-migrate/test/test_image_probe.mjs +120 -0
- package/skills/a2h-app-migrate/test/test_infer_android_root.mjs +91 -0
- package/skills/a2h-app-migrate/test/test_interaction.mjs +122 -0
- package/skills/a2h-app-migrate/test/test_json_io.mjs +32 -0
- package/skills/a2h-app-migrate/test/test_leaf_questions.mjs +111 -0
- package/skills/a2h-app-migrate/test/test_module_docs_done.mjs +53 -0
- package/skills/a2h-app-migrate/test/test_parse_args.mjs +69 -0
- package/skills/a2h-app-migrate/test/test_preflight_report.mjs +93 -0
- package/skills/a2h-app-migrate/test/test_resume_plan.mjs +219 -0
- package/skills/a2h-app-migrate/test/test_resume_summary.mjs +196 -0
- package/skills/a2h-app-migrate/test/test_reuse_static_utg.mjs +100 -0
- package/skills/a2h-app-migrate/test/test_run_dir.mjs +488 -0
- package/skills/a2h-app-migrate/test/test_skill_doc.mjs +144 -0
- package/skills/a2h-app-migrate/test/test_spec_engine_acceptance.mjs +94 -0
- package/skills/a2h-app-migrate/test/test_spec_engine_contract.mjs +147 -0
- package/skills/a2h-app-migrate/test/test_spec_gen_done.mjs +146 -0
- package/skills/a2h-app-migrate/test/test_spec_gen_gate.mjs +161 -0
- package/skills/a2h-app-migrate/test/test_spec_pipeline_done.mjs +344 -0
- package/skills/a2h-app-migrate/test/test_specs_json_preflight.mjs +76 -0
- package/skills/a2h-app-migrate/test/test_ui_batch_done.mjs +53 -0
- package/skills/a2h-app-migrate/test/test_ui_batch_gate.mjs +226 -0
- package/skills/a2h-app-migrate/test/test_uniapp_preflight.mjs +83 -0
- package/skills/a2h-app-migrate/test/test_user_facing_progress.mjs +43 -0
- package/skills/a2h-app-migrate/test/test_utg_dirs.mjs +41 -0
- package/skills/a2h-app-migrate/test/test_utg_static_done.mjs +178 -0
- package/skills/a2h-app-migrate/test/test_validate_races.mjs +50 -0
- package/skills/a2h-app-migrate/test/test_validate_workflow_bilingual.mjs +87 -0
- package/skills/a2h-arch-generate/SKILL.md +1 -1
- package/skills/a2h-arch-generate/references/database-schema-recovery.md +2 -2
- package/skills/a2h-arch-generate/references/harmony-project-inspection.md +8 -8
- package/skills/a2h-arch-generate/references/homegraph-workflow.md +15 -6
- package/skills/a2h-arch-generate/references/module-evidence-subagent.md +2 -2
- package/skills/a2h-arch-generate/references/source-baseline.md +2 -2
- package/skills/a2h-arch-generate/scripts/generate_source_baseline.mjs +35 -46
- package/skills/a2h-arch-generate/scripts/inspect_harmony_target.mjs +33 -40
- package/skills/a2h-arch-generate/scripts/module_create/generate.mjs +2 -3
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/android_source/app/build.gradle +11 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/android_source/app/src/main/AndroidManifest.xml +12 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/android_source/app/src/main/java/com/example/notes/MainActivity.kt +8 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/android_source/app/src/main/java/com/example/notes/NotesStore.kt +17 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/android_source/build.gradle +3 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/android_source/settings.gradle +1 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/AppScope/app.json5 +8 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/build-profile.json5 +14 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/common/utils/build-profile.json5 +7 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/common/utils/oh-package.json5 +1 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/common/utils/src/main/ets/utils/Format.ets +3 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/features/home/build-profile.json5 +7 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/features/home/oh-package.json5 +1 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/features/home/src/main/ets/pages/Home.ets +3 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/features/sync/build-profile.json5 +7 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/features/sync/oh-package.json5 +1 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/features/sync/src/main/ets/engine/SyncEngine.ets +3 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/hvigorfile.ts +1 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/oh-package.json5 +1 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/products/app/build-profile.json5 +7 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/products/app/oh-package.json5 +9 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/harmony_target/products/app/src/main/ets/pages/Index.ets +7 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/uniapp_source/App.vue +10 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/uniapp_source/manifest.json +6 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/uniapp_source/pages/index/index.vue +16 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/fixtures/uniapp_source/pages.json +5 -0
- package/skills/a2h-arch-generate/scripts/tests/e2e/run_e2e.mjs +548 -0
- package/skills/a2h-arch-generate/scripts/tests/run_tests.mjs +1260 -0
- package/skills/a2h-arch-generate/scripts/tests/test_cleanup.mjs +191 -0
- package/skills/a2h-arch-generate/scripts/tests/test_console_encoding.mjs +52 -0
- package/skills/a2h-arch-generate/scripts/tests/test_git_root.mjs +34 -0
- package/skills/a2h-arch-generate/scripts/tests/test_module_templates.mjs +70 -0
- package/skills/a2h-arch-generate/scripts/tests/test_router.mjs +138 -0
- package/skills/a2h-arch-generate/scripts/validate_architecture_docs.mjs +2 -5
- package/skills/a2h-arkts-logic-coder/SKILL.md +21 -2
- package/skills/a2h-arkts-logic-coder/references/ISSUES.md +1 -0
- package/skills/a2h-arkts-logic-coder/references/code-generation.md +62 -0
- package/skills/a2h-arkts-logic-coder/references/spec-design.md +4 -0
- package/skills/a2h-arkts-logic-coder/scripts/design/validate_spec_design_output.mjs +22 -25
- package/skills/a2h-arkts-logic-coder/scripts/state_doc.mjs +583 -0
- package/skills/a2h-arkts-logic-coder/test/golden/inspect_happy.json +20 -0
- package/skills/a2h-arkts-logic-coder/test/golden/move_design.md +18 -0
- package/skills/a2h-arkts-logic-coder/test/golden/move_design_crlf.md +18 -0
- package/skills/a2h-arkts-logic-coder/test/golden/move_spec.md +7 -0
- package/skills/a2h-arkts-logic-coder/test/golden/resolve_cases.json +36 -0
- package/skills/a2h-arkts-logic-coder/test/golden/validate_issue_file.md +12 -0
- package/skills/a2h-arkts-logic-coder/test/golden/validate_issues.json +57 -0
- package/skills/a2h-arkts-logic-coder/test/test_spec_design_scripts.mjs +547 -0
- package/skills/a2h-arkts-logic-coder/test/test_state_doc.mjs +352 -0
- package/skills/a2h-batch-ui-align/SKILL.md +6 -4
- package/skills/a2h-batch-ui-align/references/cards/geometry.md +1 -1
- package/skills/a2h-batch-ui-align/references/cards/resources.md +4 -0
- package/skills/a2h-batch-ui-align/references/cards/widgets.md +22 -3
- package/skills/a2h-batch-ui-align/references/checker-rules.md +66 -3
- package/skills/a2h-batch-ui-align/references/conversion-procedure.md +45 -8
- package/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-atomic-component-mapping-reference.md +7 -5
- package/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-interaction-mapping-reference.md +2 -2
- package/skills/a2h-batch-ui-align/references/step4-prepare.md +4 -2
- package/skills/a2h-batch-ui-align/references/step5-convert.md +7 -5
- package/skills/a2h-batch-ui-align/scripts/android_parse_fast.ts +6 -7
- package/skills/a2h-batch-ui-align/scripts/build_conversion_set.mjs +84 -7
- package/skills/a2h-batch-ui-align/scripts/draw_coverage.mjs +264 -0
- package/skills/a2h-batch-ui-align/scripts/evidence_gate.mjs +229 -0
- package/skills/a2h-batch-ui-align/scripts/export_ui_info.mjs +1 -2
- package/skills/a2h-batch-ui-align/scripts/generate_pages_json.mjs +4 -5
- package/skills/a2h-batch-ui-align/scripts/group_pack.mjs +88 -26
- package/skills/a2h-batch-ui-align/scripts/group_queue.mjs +305 -12
- package/skills/a2h-batch-ui-align/scripts/image_probe.mjs +231 -54
- package/skills/a2h-batch-ui-align/scripts/measure_pack.ts +8 -9
- package/skills/a2h-batch-ui-align/scripts/phase5_check.mjs +18 -5
- package/skills/a2h-batch-ui-align/scripts/shell_contract.mjs +103 -3
- package/skills/a2h-batch-ui-align/scripts/static_check/core/android.ts +231 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/core/i18n.ts +1 -5
- package/skills/a2h-batch-ui-align/scripts/static_check/main.ts +14 -8
- package/skills/a2h-batch-ui-align/scripts/static_check/registry.ts +8 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/android_immersive.ts +3 -3
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/blur_mirrored.ts +2 -2
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/builder_invokes_callback.ts +84 -19
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/color_string.ts +11 -4
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/constant_coordinate.ts +2 -2
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/framework_dialog.ts +110 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/framework_picker.ts +5 -5
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/media_content.ts +2 -2
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/media_tint.ts +66 -2
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/padding_in_size.ts +119 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/popup_menu.ts +81 -8
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/scroll_delta.ts +178 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/theme_color.ts +123 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/window_mode.ts +2 -3
- package/skills/a2h-batch-ui-align/scripts/static_check/scan_file.ts +6 -0
- package/skills/a2h-batch-ui-align/scripts/tests/agent_cli.test.mjs +217 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_a11y.test.mjs +598 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_align_tint.test.mjs +312 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_blur.test.mjs +217 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_builder_calls.test.mjs +323 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_canvas_pct.test.mjs +312 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_fidelity.test.mjs +507 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_layout_placement.test.mjs +427 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_occlusion_offset_format.test.mjs +372 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_review_fixes.test.mjs +298 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_rule_smoke.test.mjs +235 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_rules.test.mjs +365 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_scroll_padding_raster.test.mjs +262 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_scroll_safearea.test.mjs +742 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_shell.test.mjs +91 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_theme.test.mjs +86 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_weight_color.test.mjs +473 -0
- package/skills/a2h-batch-ui-align/scripts/tests/build_conversion_set.test.mjs +567 -0
- package/skills/a2h-batch-ui-align/scripts/tests/build_conversion_set_scope.test.mjs +290 -0
- package/skills/a2h-batch-ui-align/scripts/tests/color_utils_asset.test.mjs +74 -0
- package/skills/a2h-batch-ui-align/scripts/tests/detect_paradigm.test.mjs +260 -0
- package/skills/a2h-batch-ui-align/scripts/tests/draw_coverage.test.mjs +244 -0
- package/skills/a2h-batch-ui-align/scripts/tests/evidence_gate.test.mjs +420 -0
- package/skills/a2h-batch-ui-align/scripts/tests/export_scroll_states.test.mjs +31 -0
- package/skills/a2h-batch-ui-align/scripts/tests/export_ui_info.test.mjs +742 -0
- package/skills/a2h-batch-ui-align/scripts/tests/generate_pages_json.test.mjs +123 -0
- package/skills/a2h-batch-ui-align/scripts/tests/group_commit.test.mjs +126 -0
- package/skills/a2h-batch-ui-align/scripts/tests/group_pack.test.mjs +363 -0
- package/skills/a2h-batch-ui-align/scripts/tests/group_queue.test.mjs +1628 -0
- package/skills/a2h-batch-ui-align/scripts/tests/group_watch.test.mjs +215 -0
- package/skills/a2h-batch-ui-align/scripts/tests/harmony_index.test.mjs +95 -0
- package/skills/a2h-batch-ui-align/scripts/tests/host_env.test.mjs +115 -0
- package/skills/a2h-batch-ui-align/scripts/tests/image_probe.test.mjs +243 -0
- package/skills/a2h-batch-ui-align/scripts/tests/measure_pack.test.mjs +324 -0
- package/skills/a2h-batch-ui-align/scripts/tests/occlusion.test.mjs +102 -0
- package/skills/a2h-batch-ui-align/scripts/tests/phase5_check.test.mjs +325 -0
- package/skills/a2h-batch-ui-align/scripts/tests/shell_contract.test.mjs +297 -0
- package/skills/a2h-batch-ui-align/scripts/tests/skill_doc_contract.test.mjs +48 -0
- package/skills/a2h-batch-ui-align/scripts/tests/state_doc.test.mjs +387 -0
- package/skills/a2h-batch-ui-align/scripts/tests/static_check_registry.test.mjs +122 -0
- package/skills/a2h-batch-ui-align/scripts/tests/test_bfs_exit.ts +49 -0
- package/skills/a2h-batch-ui-align/scripts/tests/text_color_diff.test.mjs +250 -0
- package/skills/a2h-dashboard-render/scripts/dashboard.mjs +12 -14
- package/skills/a2h-dashboard-render/scripts/device_capture.mjs +29 -30
- package/skills/a2h-dashboard-render/test/fixtures/page_capture/broken.xml +1 -0
- package/skills/a2h-dashboard-render/test/fixtures/page_capture/expected.json +156 -0
- package/skills/a2h-dashboard-render/test/fixtures/page_capture/hmos.json +1 -0
- package/skills/a2h-dashboard-render/test/fixtures/page_capture/list.xml +1 -0
- package/skills/a2h-dashboard-render/test/fixtures/page_capture/nested_scroll.xml +1 -0
- package/skills/a2h-dashboard-render/test/test_artifact_contract.mjs +168 -0
- package/skills/a2h-dashboard-render/test/test_cli_check_registry.mjs +99 -0
- package/skills/a2h-dashboard-render/test/test_dashboard_architecture.mjs +118 -0
- package/skills/a2h-dashboard-render/test/test_dashboard_build.mjs +93 -0
- package/skills/a2h-dashboard-render/test/test_dashboard_i18n.mjs +203 -0
- package/skills/a2h-dashboard-render/test/test_dashboard_node.mjs +1369 -0
- package/skills/a2h-dashboard-render/test/test_dashboard_spec_pipeline.mjs +318 -0
- package/skills/a2h-dashboard-render/test/test_dashboard_ui_pipeline.mjs +81 -0
- package/skills/a2h-dashboard-render/test/test_device_capture_env.mjs +115 -0
- package/skills/a2h-dashboard-render/test/test_device_capture_policy.mjs +411 -0
- package/skills/a2h-dashboard-render/test/test_page_capture.mjs +147 -0
- package/skills/a2h-dashboard-render/test/test_usage_readers.mjs +512 -0
- package/skills/a2h-module-semantic-docs/test/golden/module_structure.json +187 -0
- package/skills/a2h-module-semantic-docs/test/golden/module_understanding.json +351 -0
- package/skills/a2h-module-semantic-docs/test/golden/module_update_plan.json +495 -0
- package/skills/a2h-module-semantic-docs/test/golden/project_directory_structure.json +157 -0
- package/skills/a2h-module-semantic-docs/test/test_scan_and_commit.mjs +388 -0
- package/skills/a2h-page-specgen/SKILL.md +136 -0
- package/skills/a2h-page-specgen/references/body-language.md +177 -0
- package/skills/a2h-page-specgen/references/evidence.md +70 -0
- package/skills/a2h-page-specgen/references/execution-model.md +255 -0
- package/skills/a2h-page-specgen/references/footprint-and-grouping.md +250 -0
- package/skills/a2h-page-specgen/references/gates.md +255 -0
- package/skills/a2h-page-specgen/references/page-inventory.md +173 -0
- package/skills/a2h-page-specgen/references/spec-template.md +207 -0
- package/skills/a2h-page-specgen/scripts/dispatch.mjs +209 -0
- package/skills/a2h-page-specgen/scripts/facts-build.mjs +1504 -0
- package/skills/a2h-page-specgen/scripts/finalize.mjs +422 -0
- package/skills/a2h-page-specgen/scripts/footprint.mjs +1528 -0
- package/skills/a2h-page-specgen/scripts/gate.mjs +558 -0
- package/skills/a2h-page-specgen/scripts/interactions.mjs +137 -0
- package/skills/a2h-page-specgen/scripts/inventory.mjs +269 -0
- package/skills/a2h-page-specgen/scripts/lib/contracts.mjs +255 -0
- package/skills/a2h-page-specgen/scripts/lib/deps-source.mjs +399 -0
- package/skills/a2h-page-specgen/scripts/lib/draft-store.mjs +137 -0
- package/skills/a2h-page-specgen/scripts/lib/footprint-roles.mjs +278 -0
- package/skills/a2h-page-specgen/scripts/lib/fsx.mjs +79 -0
- package/skills/a2h-page-specgen/scripts/lib/hg.mjs +175 -0
- package/skills/a2h-page-specgen/scripts/lib/ledger.mjs +355 -0
- package/skills/a2h-page-specgen/scripts/lib/prose.mjs +234 -0
- package/skills/a2h-page-specgen/scripts/lib/reach.mjs +53 -0
- package/skills/a2h-page-specgen/scripts/lib/source-text.mjs +391 -0
- package/skills/a2h-page-specgen/scripts/lib/symbols.mjs +125 -0
- package/skills/a2h-page-specgen/scripts/lib/utg-io.mjs +110 -0
- package/skills/a2h-page-specgen/scripts/lib/waker-event-store.mjs +658 -0
- package/skills/a2h-page-specgen/scripts/prepare.mjs +492 -0
- package/skills/a2h-page-specgen/scripts/render.mjs +317 -0
- package/skills/a2h-page-specgen/scripts/report.mjs +7 -0
- package/skills/a2h-page-specgen/scripts/submission.mjs +532 -0
- package/skills/a2h-page-specgen/scripts/submit.mjs +79 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/README.md +77 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/acceptance.mjs +590 -0
- package/skills/a2h-page-specgen/scripts/test/acceptance/cases.example.json +57 -0
- package/skills/a2h-page-specgen/scripts/test/contracts.test.mjs +207 -0
- package/skills/a2h-page-specgen/scripts/test/dispatch.test.mjs +258 -0
- package/skills/a2h-page-specgen/scripts/test/facts.test.mjs +1164 -0
- package/skills/a2h-page-specgen/scripts/test/finalize.test.mjs +74 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/Api.kt +20 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/BothAnnotations.kt +28 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/Cache.kt +7 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/Comments.kt +26 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/Mmkv.kt +7 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/Models.kt +19 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/Pair.kt +7 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/Prefs.kt +9 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/Room.kt +11 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/Sample.kt +43 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/Templates.kt +34 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/Timeouts.kt +8 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/androidTest/Helper.kt +5 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/build.gradle.kts +16 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/i18n/en.js.txt +5 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/i18n/zh.js.txt +4 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/libs.versions.toml +14 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/package.json +10 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/res/values/strings.xml +10 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/res/values-b+zh+Hans/strings.xml +4 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/res/values-land/strings.xml +5 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/res/values-night/strings.xml +5 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/res/values-v21/strings.xml +4 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/res/values-zh/strings.xml +4 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/test/Legacy.kt +4 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts/weather.proto +11 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts-container/src/AppPreferences.kt +13 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts-container/src/SettingsViewModel.kt +16 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts-dao/src/UserDao.kt +28 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts-moko/i18n/src/commonMain/moko-resources/base/strings.xml +6 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts-moko/i18n/src/commonMain/moko-resources/fil/strings.xml +6 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts-pref/res/values/arrays.xml +25 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts-pref/res/values/strings.xml +10 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts-pref/res/xml/prefs.xml +27 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts-pref/src/Api.java +19 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts-pref/src/Datastore.kt +12 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts-pref/src/Settings.java +13 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts-pref/src/forecast.js +14 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts-pref/src/store.js +14 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts-receiver/src/BasePreferences.kt +13 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts-receiver/src/Screen.kt +14 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts-receiver/src/UiPreferences.kt +8 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/facts-retrofit/src/AuthAPI.kt +26 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/fp/AndroidManifest.xml +20 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/fp/feature/auth/navigation/ScreenRoute.kt +8 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/fp/pages.json +19 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/fp/src/components/Widget.vue +11 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/fp/src/pages/detail/detail.vue +14 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/fp/src/pages/index/index.vue +24 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/fp/src/store/userStore.js +11 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/fp/src/uni_modules/uview-ui/components/u-thing.js +5 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/fp.mkdb.mjs +144 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/hg.mkdb.mjs +94 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/src/MainFragment.java +6 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/src/ManyListeners.java +12 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/src/PlainActivity.java +3 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/utg/click_paths.json +28 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/utg/fold-chain/utg.json +12 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/utg/utg.json +34 -0
- package/skills/a2h-page-specgen/scripts/test/footprint-resolve.test.mjs +758 -0
- package/skills/a2h-page-specgen/scripts/test/footprint-roles.test.mjs +172 -0
- package/skills/a2h-page-specgen/scripts/test/fsx.test.mjs +32 -0
- package/skills/a2h-page-specgen/scripts/test/gate-partial.test.mjs +54 -0
- package/skills/a2h-page-specgen/scripts/test/gate.test.mjs +222 -0
- package/skills/a2h-page-specgen/scripts/test/helpers.mjs +54 -0
- package/skills/a2h-page-specgen/scripts/test/hg.test.mjs +171 -0
- package/skills/a2h-page-specgen/scripts/test/integration.test.mjs +301 -0
- package/skills/a2h-page-specgen/scripts/test/interactions.test.mjs +45 -0
- package/skills/a2h-page-specgen/scripts/test/inventory.test.mjs +139 -0
- package/skills/a2h-page-specgen/scripts/test/keys.test.mjs +774 -0
- package/skills/a2h-page-specgen/scripts/test/ledger.test.mjs +464 -0
- package/skills/a2h-page-specgen/scripts/test/plan-build.test.mjs +1011 -0
- package/skills/a2h-page-specgen/scripts/test/prepare-index.test.mjs +120 -0
- package/skills/a2h-page-specgen/scripts/test/prompt-tpl.test.mjs +68 -0
- package/skills/a2h-page-specgen/scripts/test/prose.test.mjs +390 -0
- package/skills/a2h-page-specgen/scripts/test/protocol-docs.test.mjs +167 -0
- package/skills/a2h-page-specgen/scripts/test/reach.test.mjs +93 -0
- package/skills/a2h-page-specgen/scripts/test/recovery-e2e.test.mjs +323 -0
- package/skills/a2h-page-specgen/scripts/test/recovery.test.mjs +546 -0
- package/skills/a2h-page-specgen/scripts/test/render.test.mjs +503 -0
- package/skills/a2h-page-specgen/scripts/test/source-text.test.mjs +181 -0
- package/skills/a2h-page-specgen/scripts/test/submit.test.mjs +701 -0
- package/skills/a2h-page-specgen/scripts/test/utg-io.test.mjs +90 -0
- package/skills/a2h-page-specgen/scripts/test/waker-event-store.test.mjs +1365 -0
- package/skills/a2h-page-specgen/scripts/test/waker-process.test.mjs +1765 -0
- package/skills/a2h-page-specgen/scripts/test/waker.test.mjs +1979 -0
- package/skills/a2h-page-specgen/scripts/test/watchdog.test.mjs +313 -0
- package/skills/a2h-page-specgen/scripts/waker.mjs +1234 -0
- package/skills/a2h-page-specgen/scripts/watchdog.mjs +298 -0
- package/skills/a2h-resource-convert/scripts/a2h_resource_convert.ts +49 -51
- package/skills/a2h-resource-convert/scripts/tests/adaptive_icon.test.mjs +182 -0
- package/skills/a2h-resource-convert/scripts/tests/app_identity.test.mjs +206 -0
- package/skills/a2h-resource-convert/scripts/tests/docs_only_i18n.test.mjs +44 -0
- package/skills/a2h-spec-design-pipeline/SKILL.md +79 -78
- package/skills/a2h-spec-design-pipeline/references/coding-loop.md +51 -12
- package/skills/a2h-spec-design-pipeline/references/execution-model.md +24 -6
- package/skills/a2h-spec-design-pipeline/references/final-report-template.md +3 -2
- package/skills/a2h-spec-design-pipeline/references/initialization.md +15 -4
- package/skills/a2h-spec-design-pipeline/references/merge-queue.md +82 -41
- package/skills/a2h-spec-design-pipeline/references/resolver-prompt.md +61 -0
- package/skills/a2h-spec-design-pipeline/references/scripts.md +19 -10
- package/skills/a2h-spec-design-pipeline/references/shared-layer.md +267 -0
- package/skills/a2h-spec-design-pipeline/references/state-and-resume.md +61 -8
- package/skills/a2h-spec-design-pipeline/references/static-defect-gate.md +62 -13
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/config/ruleMeta.json +8 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/config/ruleSet.json +8 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/http-extra-data-empty-string-cn.md +55 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/http-extra-data-empty-string-en.md +60 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/HttpExtraDataEmptyStringCheck.js +488 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/index.js +11 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/package.json +17 -0
- package/skills/a2h-spec-design-pipeline/scripts/branch_landed.ts +12 -38
- package/skills/a2h-spec-design-pipeline/scripts/dispatch/evidence.mjs +40 -5
- package/skills/a2h-spec-design-pipeline/scripts/dispatch/fold.mjs +18 -0
- package/skills/a2h-spec-design-pipeline/scripts/dispatch/landing.mjs +74 -0
- package/skills/a2h-spec-design-pipeline/scripts/dispatch/progress.mjs +1 -1
- package/skills/a2h-spec-design-pipeline/scripts/dispatch/wait.mjs +1 -1
- package/skills/a2h-spec-design-pipeline/scripts/dispatch/worktree.mjs +2 -2
- package/skills/a2h-spec-design-pipeline/scripts/dispatch.mjs +128 -5
- package/skills/a2h-spec-design-pipeline/scripts/ensure_wt_index.ts +98 -35
- package/skills/a2h-spec-design-pipeline/scripts/homecheck_scan.ts +218 -37
- package/skills/a2h-spec-design-pipeline/scripts/lib/shared_classes.ts +113 -0
- package/skills/a2h-spec-design-pipeline/scripts/lib/shared_docs.ts +202 -0
- package/skills/a2h-spec-design-pipeline/scripts/lib/wiring.ts +58 -0
- package/skills/a2h-spec-design-pipeline/scripts/plan_groups.ts +6 -7
- package/skills/a2h-spec-design-pipeline/scripts/resolve_wiring.ts +3 -0
- package/skills/a2h-spec-design-pipeline/scripts/resolver_prompt.ts +348 -0
- package/skills/a2h-spec-design-pipeline/scripts/scan_shared.ts +642 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_commands.mjs +15 -5
- package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_e2e.mjs +7 -2
- package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_evidence.mjs +104 -1
- package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_fold.mjs +24 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_landing.mjs +394 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_progress.mjs +24 -1
- package/skills/a2h-spec-design-pipeline/scripts/test_dispatch_wait.mjs +14 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_ensure_wt_index.ts +163 -5
- package/skills/a2h-spec-design-pipeline/scripts/test_homecheck_scan.ts +15 -7
- package/skills/a2h-spec-design-pipeline/scripts/test_resolve_wiring.ts +14 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_resolver_prompt.ts +350 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_scan_shared.ts +996 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_shared_classes.ts +80 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_shared_docs.ts +205 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_shared_layer_docs.ts +121 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_shared_layer_e2e.ts +85 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_validate_shared_manifest.ts +720 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_wiring.ts +40 -0
- package/skills/a2h-spec-design-pipeline/scripts/validate_shared_manifest.ts +566 -0
- package/skills/a2h-spec-generate/SKILL.md +87 -21
- package/skills/a2h-spec-generate/references/batch-mode.md +78 -17
- package/skills/a2h-spec-generate/references/dispatch-watchdog.md +150 -0
- package/skills/a2h-spec-generate/references/fusion-task-contract.md +7 -0
- package/skills/a2h-spec-generate/references/review-checklist.md +1 -0
- package/skills/a2h-spec-generate/references/synthesis-rules.md +4 -2
- package/skills/a2h-spec-generate/references/worker-rules.md +6 -3
- package/skills/a2h-spec-generate/scripts/check-fused-spec.mjs +4 -5
- package/skills/a2h-spec-generate/scripts/check_spec.ts +145 -14
- package/skills/a2h-spec-generate/scripts/collect-specs.mjs +261 -19
- package/skills/a2h-spec-generate/scripts/dispatch-watch.mjs +1168 -0
- package/skills/a2h-spec-generate/scripts/feature-stem.mjs +1 -2
- package/skills/a2h-spec-generate/scripts/publish-specs.mjs +1 -2
- package/skills/a2h-spec-generate/scripts/regroup-by-page.mjs +1 -2
- package/skills/a2h-spec-generate/scripts/render-tasks.mjs +25 -46
- package/skills/a2h-spec-generate/scripts/reqgen/src/analysis/graph/build.ts +26 -27
- package/skills/a2h-spec-generate/scripts/reqgen/src/analysis/graph/component-variants.ts +3 -6
- package/skills/a2h-spec-generate/scripts/reqgen/src/analysis/names/policy.ts +31 -32
- package/skills/a2h-spec-generate/scripts/reqgen/src/analysis/names/traceability.ts +2 -3
- package/skills/a2h-spec-generate/scripts/reqgen/src/analysis/req-model/build.ts +15 -26
- package/skills/a2h-spec-generate/scripts/reqgen/src/fusion/area-facts.ts +102 -81
- package/skills/a2h-spec-generate/scripts/reqgen/src/fusion/behavior-seed.ts +39 -19
- package/skills/a2h-spec-generate/scripts/reqgen/src/fusion/library-evidence.ts +12 -13
- package/skills/a2h-spec-generate/scripts/reqgen/src/fusion/navigation-guard.ts +363 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/fusion/task-contract.ts +35 -196
- package/skills/a2h-spec-generate/scripts/reqgen/src/interaction-analysis/contracts.ts +3 -1
- package/skills/a2h-spec-generate/scripts/reqgen/src/interaction-analysis/task-contract.ts +22 -96
- package/skills/a2h-spec-generate/scripts/reqgen/src/interaction-analysis/tree-sitter-adapter.ts +3 -4
- package/skills/a2h-spec-generate/scripts/reqgen/src/model/contracts.ts +1 -1
- package/skills/a2h-spec-generate/scripts/reqgen/src/model/finalize.ts +74 -7
- package/skills/a2h-spec-generate/scripts/reqgen/src/model/prepare.ts +51 -7
- package/skills/a2h-spec-generate/scripts/reqgen/src/model/task.ts +42 -111
- package/skills/a2h-spec-generate/scripts/reqgen/src/requirement-scope.ts +1 -20
- package/skills/a2h-spec-generate/scripts/reqgen/src/source-index/homegraph.ts +1 -2
- package/skills/a2h-spec-generate/scripts/reqgen/src/validation/req-text.ts +3 -4
- package/skills/a2h-spec-generate/scripts/reqgen/test/control-fact-join.test.ts +50 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/control-name-uniapp.test.ts +75 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/cross-area-anchor.test.ts +256 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/fixtures/fusion-run.ts +243 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/fixtures/zip.ts +63 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-area-facts.test.ts +650 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-behavior-detectors.test.ts +176 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-behavior-e2e.test.ts +103 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-behavior-schema.test.ts +111 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-behavior-seed.test.ts +195 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-behavior-selfcheck.test.ts +307 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-contract.test.ts +347 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-finalize.test.ts +1948 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-library-evidence.test.ts +239 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-navigation-guard.test.ts +277 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-prepare.test.ts +844 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-scope.test.ts +339 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-selfcheck.test.ts +1253 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-spec.test.ts +608 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/model-cli-blockers.test.ts +117 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/model-scope.test.ts +411 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/model-seeds.test.ts +175 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/model-task-contract.test.ts +300 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/model-v4.test.ts +1061 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/specgen-completeness.test.ts +286 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/stagem-stored-path.test.ts +25 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/uniapp-scanner.test.ts +159 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/zip.test.ts +61 -0
- package/skills/a2h-spec-generate/test/check-fused-spec.test.mjs +879 -0
- package/skills/a2h-spec-generate/test/check-spec.test.ts +430 -0
- package/skills/a2h-spec-generate/test/collect-specs.test.mjs +811 -0
- package/skills/a2h-spec-generate/test/detect-project.test.mjs +37 -0
- package/skills/a2h-spec-generate/test/dispatch-watch.test.mjs +606 -0
- package/skills/a2h-spec-generate/test/ensure-index.test.mjs +230 -0
- package/skills/a2h-spec-generate/test/feature-stem.test.mjs +157 -0
- package/skills/a2h-spec-generate/test/fixtures/android/app/src/main/AndroidManifest.xml +3 -0
- package/skills/a2h-spec-generate/test/fixtures/android/build.gradle +3 -0
- package/skills/a2h-spec-generate/test/fixtures/android/settings.gradle +3 -0
- package/skills/a2h-spec-generate/test/fixtures/uniapp-src/package.json +9 -0
- package/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/App.vue +8 -0
- package/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/components/MyCard.vue +9 -0
- package/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/feature/editor/index.vue +1 -0
- package/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/main.ts +6 -0
- package/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/manifest.json +4 -0
- package/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/pages/detail/index.vue +1 -0
- package/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/pages/home/index.vue +33 -0
- package/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/pages/settings/index.vue +1 -0
- package/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/pages.json +23 -0
- package/skills/a2h-spec-generate/test/fixtures/uniapp-src/src/services/items.ts +3 -0
- package/skills/a2h-spec-generate/test/fixtures/uniapp-src/tsconfig.json +8 -0
- package/skills/a2h-spec-generate/test/fixtures/unknown/README.txt +1 -0
- package/skills/a2h-spec-generate/test/inspect-uniapp.test.mjs +54 -0
- package/skills/a2h-spec-generate/test/prepare-facts.test.mjs +41 -0
- package/skills/a2h-spec-generate/test/publication-verdict.test.mjs +182 -0
- package/skills/a2h-spec-generate/test/publish-specs.test.mjs +295 -0
- package/skills/a2h-spec-generate/test/regroup-by-page.test.mjs +354 -0
- package/skills/a2h-spec-generate/test/render-tasks.test.mjs +596 -0
- package/skills/a2h-spec-generate/test/report.test.mjs +47 -0
- package/skills/a2h-utg-explorer/references/architecture.md +4 -0
- package/skills/a2h-utg-explorer/scripts/compile_tasks.mjs +64 -80
- package/skills/a2h-utg-explorer/scripts/hint_check.mjs +1 -2
- package/skills/a2h-utg-explorer/scripts/recover.mjs +1 -1
- package/skills/a2h-utg-explorer/scripts/rejudge.mjs +5 -3
- package/skills/a2h-utg-explorer/scripts/tests/attest.test.mjs +66 -0
- package/skills/a2h-utg-explorer/scripts/tests/calendar_round_fixes.test.mjs +244 -0
- package/skills/a2h-utg-explorer/scripts/tests/chain.test.mjs +45 -0
- package/skills/a2h-utg-explorer/scripts/tests/compose_identity.test.mjs +302 -0
- package/skills/a2h-utg-explorer/scripts/tests/content_wait.test.mjs +207 -0
- package/skills/a2h-utg-explorer/scripts/tests/coverage_rules.test.mjs +104 -0
- package/skills/a2h-utg-explorer/scripts/tests/d_prereqs.test.mjs +231 -0
- package/skills/a2h-utg-explorer/scripts/tests/device_health.test.mjs +160 -0
- package/skills/a2h-utg-explorer/scripts/tests/device_locale_identity.test.mjs +77 -0
- package/skills/a2h-utg-explorer/scripts/tests/device_lock_retry.test.mjs +187 -0
- package/skills/a2h-utg-explorer/scripts/tests/direct_launch.test.mjs +130 -0
- package/skills/a2h-utg-explorer/scripts/tests/explorer_review_fixes.test.mjs +137 -0
- package/skills/a2h-utg-explorer/scripts/tests/final_utg.test.mjs +135 -0
- package/skills/a2h-utg-explorer/scripts/tests/first_round_phases.test.mjs +16 -0
- package/skills/a2h-utg-explorer/scripts/tests/fresh_state_plan.test.mjs +78 -0
- package/skills/a2h-utg-explorer/scripts/tests/generalization_fixes.test.mjs +252 -0
- package/skills/a2h-utg-explorer/scripts/tests/hint_check.test.mjs +129 -0
- package/skills/a2h-utg-explorer/scripts/tests/holds_without_data_parity.test.mjs +26 -0
- package/skills/a2h-utg-explorer/scripts/tests/interruptions.test.mjs +492 -0
- package/skills/a2h-utg-explorer/scripts/tests/launch_bridge.test.mjs +199 -0
- package/skills/a2h-utg-explorer/scripts/tests/launch_failure.test.mjs +40 -0
- package/skills/a2h-utg-explorer/scripts/tests/node_coverage.test.mjs +193 -0
- package/skills/a2h-utg-explorer/scripts/tests/overflow_prefix.test.mjs +327 -0
- package/skills/a2h-utg-explorer/scripts/tests/overlay_identity.test.mjs +204 -0
- package/skills/a2h-utg-explorer/scripts/tests/page_identity_tiers.test.mjs +393 -0
- package/skills/a2h-utg-explorer/scripts/tests/pager_navigation.test.mjs +119 -0
- package/skills/a2h-utg-explorer/scripts/tests/panel_routes.test.mjs +208 -0
- package/skills/a2h-utg-explorer/scripts/tests/pipeline.test.mjs +240 -0
- package/skills/a2h-utg-explorer/scripts/tests/recover.test.mjs +212 -0
- package/skills/a2h-utg-explorer/scripts/tests/recover_b.test.mjs +173 -0
- package/skills/a2h-utg-explorer/scripts/tests/recover_d.test.mjs +280 -0
- package/skills/a2h-utg-explorer/scripts/tests/review_fixes.test.mjs +213 -0
- package/skills/a2h-utg-explorer/scripts/tests/robustness_fixes.test.mjs +345 -0
- package/skills/a2h-utg-explorer/scripts/tests/run_cycle.test.mjs +454 -0
- package/skills/a2h-utg-explorer/scripts/tests/runner_capabilities.test.mjs +194 -0
- package/skills/a2h-utg-explorer/scripts/tests/scope.test.mjs +229 -0
- package/skills/a2h-utg-explorer/scripts/tests/scroll_sweep.test.mjs +336 -0
- package/skills/a2h-utg-explorer/scripts/tests/semantics.test.mjs +102 -0
- package/skills/a2h-utg-explorer/scripts/tests/snapshot_integrity.test.mjs +142 -0
- package/skills/a2h-utg-explorer/scripts/tests/state_ambiguity.test.mjs +92 -0
- package/skills/a2h-utg-explorer/scripts/tests/string_tables_twin_ties.test.mjs +83 -0
- package/skills/a2h-utg-explorer/scripts/tests/tar_fixture.mjs +12 -0
- package/skills/a2h-utg-explorer/scripts/tests/twin_opener.test.mjs +119 -0
- package/skills/a2h-utg-explorer/scripts/tests/u2_backend.test.mjs +346 -0
- package/skills/a2h-utg-explorer/scripts/tests/ui_state_anchors.test.mjs +112 -0
- package/skills/a2h-utg-explorer/scripts/tests/variant_strings.test.mjs +63 -0
- package/skills/a2h-utg-explorer/scripts/tests/worklist_parts.test.mjs +24 -0
- package/skills/a2h-utg-explorer/scripts/utg_explorer/adapters.mjs +13 -3
- package/skills/a2h-utg-explorer/scripts/utg_explorer/semantics.mjs +107 -65
- package/skills/a2h-utg-explorer/scripts/utg_explorer/strings.mjs +155 -0
- package/skills/a2h-utg-static/scripts/assemble.mjs +28 -3
- package/skills/a2h-utg-static/scripts/click_paths.mjs +19 -20
- package/skills/a2h-utg-static/scripts/compose_overlay.mjs +102 -2
- package/skills/a2h-utg-static/scripts/fragment_nav.mjs +2 -3
- package/skills/a2h-utg-static/scripts/nl_hints.mjs +2 -3
- package/skills/a2h-utg-static/scripts/presenter_nav.mjs +1 -2
- package/skills/a2h-utg-static/scripts/route_interceptor.mjs +21 -7
- package/skills/a2h-utg-static/scripts/static_prior.mjs +26 -29
- package/skills/a2h-utg-static/scripts/tests/test_activity_gates.mjs +84 -0
- package/skills/a2h-utg-static/scripts/tests/test_login_interceptor.mjs +38 -0
- package/skills/a2h-utg-static/scripts/tests/test_route_token_words.mjs +29 -1
- package/skills/a2h-app-migrate/scripts/i18n-term.d.mts +0 -5
- package/skills/a2h-app-migrate/scripts/i18n-term.mjs +0 -54
- package/skills/a2h-arch-generate/scripts/i18n-term.d.mts +0 -5
- package/skills/a2h-arch-generate/scripts/i18n-term.mjs +0 -54
- package/skills/a2h-arkts-logic-coder/scripts/design/i18n-term.d.mts +0 -5
- package/skills/a2h-arkts-logic-coder/scripts/design/i18n-term.mjs +0 -54
- package/skills/a2h-batch-ui-align/references/source-only-tier.md +0 -38
- package/skills/a2h-batch-ui-align/scripts/i18n-term.d.mts +0 -5
- package/skills/a2h-batch-ui-align/scripts/i18n-term.mjs +0 -54
- package/skills/a2h-dashboard-render/scripts/i18n-term.d.mts +0 -5
- package/skills/a2h-dashboard-render/scripts/i18n-term.mjs +0 -54
- package/skills/a2h-resource-convert/scripts/i18n-term.d.mts +0 -5
- package/skills/a2h-resource-convert/scripts/i18n-term.mjs +0 -54
- package/skills/a2h-spec-design-pipeline/scripts/i18n-term.d.mts +0 -5
- package/skills/a2h-spec-design-pipeline/scripts/i18n-term.mjs +0 -54
- package/skills/a2h-spec-design-pipeline/scripts/test_i18n_term.ts +0 -70
- package/skills/a2h-spec-generate/scripts/i18n-term.d.mts +0 -5
- package/skills/a2h-spec-generate/scripts/i18n-term.mjs +0 -54
- package/skills/a2h-spec-generate/scripts/reqgen/src/i18n-term.d.mts +0 -5
- package/skills/a2h-spec-generate/scripts/reqgen/src/i18n-term.mjs +0 -54
- package/skills/a2h-utg-explorer/scripts/i18n-term.d.mts +0 -5
- package/skills/a2h-utg-explorer/scripts/i18n-term.mjs +0 -54
- package/skills/a2h-utg-static/scripts/i18n-term.d.mts +0 -5
- package/skills/a2h-utg-static/scripts/i18n-term.mjs +0 -54
- package/skills/a2h-utg-static/scripts/tests/test_i18n_term.mjs +0 -155
|
@@ -0,0 +1,727 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* a2h-spec-generate — collect-specs: relocate the fused worker's per-Area SPECs
|
|
4
|
+
* into the publish root, with their control identity injected.
|
|
5
|
+
*
|
|
6
|
+
* The fused reqgen worker authors each SPEC next to its Area task
|
|
7
|
+
* (`<runDir>/interaction/area-<id>/specs/<stem>-SPEC.md`) and records the
|
|
8
|
+
* binding in `<runDir>/generation/spec-bindings.json` (`areas[].specs[]`).
|
|
9
|
+
* `publish-specs.mjs` only scans `<root>/<idx>/<stem>-SPEC.md`, so this step runs
|
|
10
|
+
* between `finalize` and `publish-specs`:
|
|
11
|
+
*
|
|
12
|
+
* 1. walk `spec-bindings.json` `areas[]` in array order — `idx = index + 1`
|
|
13
|
+
* (the array position the sidecar defines);
|
|
14
|
+
* 2. resolve EACH `specs[]` binding's task directory from its own
|
|
15
|
+
* `utgNodeId` via `interaction/manifest.json`
|
|
16
|
+
* (`areaPlans[].expected.areaRef === utgNodeId` → `expected.outputPath` →
|
|
17
|
+
* its dirname) — a sidecar area entry can fold several drafts (a supporting
|
|
18
|
+
* Area folds into its primary), so the entry's own `utgNodeId` is only the
|
|
19
|
+
* fallback for an older sidecar that predates the per-binding field;
|
|
20
|
+
* 3. for each `{ stem, utgNodeId, controlRef? }` copy
|
|
21
|
+
* `<taskDir>/specs/<stem>-SPEC.md` to `<root>/<idx>/<stem>-SPEC.md`,
|
|
22
|
+
* injecting a `Control: <controlRef>` line immediately after the H1 when the
|
|
23
|
+
* sidecar bound one (a `Control: ` line already in the file is stripped and
|
|
24
|
+
* replaced by the sidecar's authority — the fused gate rejects
|
|
25
|
+
* worker-written ones, and this step must not rely on the gate having
|
|
26
|
+
* run);
|
|
27
|
+
* 4. replace the worker's `<!-- behavior:<id> -->` coverage markers with one
|
|
28
|
+
* publisher-owned `## Source locations` section at the end of the SPEC: a
|
|
29
|
+
* `- Whole page:` bullet from the record's own `specs[].citations`, then
|
|
30
|
+
* one bullet per scenario holding the anchors of the behaviours that sat
|
|
31
|
+
* under it (the frozen draft's `behaviors[].anchors`). interaction-finalize
|
|
32
|
+
* already verified every anchor against the source census, so this step
|
|
33
|
+
* adds no claim. This is the ONLY traceability a downstream consumer gets:
|
|
34
|
+
* the body may not carry `file:line` (check_spec's `code-anchor-leak`
|
|
35
|
+
* rule), and the gate exempts a path only inside a bullet of that section.
|
|
36
|
+
*
|
|
37
|
+
* Fail-loud: a missing SPEC, an H1 that is not `# <stem>SPEC`, an `utgNodeId`
|
|
38
|
+
* with no manifest plan, or a SPEC whose `stem` is not a single path segment
|
|
39
|
+
* aborts the run (non-zero exit). Nothing is written for an Area with zero
|
|
40
|
+
* SPECs.
|
|
41
|
+
*
|
|
42
|
+
* Publication gate: the run's commit marker (`<runDir>/run-report.json`, written
|
|
43
|
+
* by `model -- finalize`) must describe a complete model. A run that is not
|
|
44
|
+
* publishable — an Area whose worker output never finalized, or an interaction
|
|
45
|
+
* candidate no Area owns — is refused (non-zero exit) instead of being collected
|
|
46
|
+
* as if it were complete; `--allow-incomplete` collects it on purpose and says so.
|
|
47
|
+
*
|
|
48
|
+
* The run's own publish root (`<runDir>/generation/specs`) is staged and swapped
|
|
49
|
+
* as a whole: every SPEC is read, validated and rendered first, the complete set
|
|
50
|
+
* is written to a sibling staging directory, and only then is the old root
|
|
51
|
+
* replaced. This matters on recovery: `idx` is the Area's position in the
|
|
52
|
+
* current sidecar, so a previously failed Area that now passes can shift every
|
|
53
|
+
* later idx. An in-place write would leave the old `<idx>/<stem>-SPEC.md` behind
|
|
54
|
+
* and `publish-specs` (which scans every `*-SPEC.md` below the root) would
|
|
55
|
+
* publish it again — duplicated content under a reassigned idx. The staging
|
|
56
|
+
* swap also makes a failed collection leave the previous root untouched.
|
|
57
|
+
*
|
|
58
|
+
* A custom `--root` keeps the legacy in-place write, because this step cannot
|
|
59
|
+
* assume it owns every file in a caller-supplied tree. Pass `--replace-root` to
|
|
60
|
+
* opt that root into the same staging swap.
|
|
61
|
+
*
|
|
62
|
+
* Within one `idx` every destination name must be unique: a duplicate (two
|
|
63
|
+
* bindings — normally two folded drafts — declaring the same stem) is refused
|
|
64
|
+
* with the error naming both origins; it is never silently overwritten.
|
|
65
|
+
*
|
|
66
|
+
* Zero third-party deps. Node ≥ 22.18.
|
|
67
|
+
*
|
|
68
|
+
* Usage:
|
|
69
|
+
* node collect-specs.mjs --run <runDir> [--root <specOutputRoot>]
|
|
70
|
+
* [--allow-incomplete] [--replace-root]
|
|
71
|
+
*
|
|
72
|
+
* --run Model run directory (holds run-report.json,
|
|
73
|
+
* generation/spec-bindings.json and interaction/manifest.json)
|
|
74
|
+
* --root Destination publish root; default <runDir>/generation/specs
|
|
75
|
+
* --allow-incomplete collect even when the run is not publishable
|
|
76
|
+
* --replace-root stage-and-swap a custom --root too (destructive: files
|
|
77
|
+
* not produced by this run are removed)
|
|
78
|
+
*
|
|
79
|
+
* Exit codes: 0 = every declared SPEC collected; 1 = any missing/mismatched
|
|
80
|
+
* SPEC, unjoinable Area, or a run the gate refuses; 2 = bad usage.
|
|
81
|
+
*
|
|
82
|
+
* Programmatic interface (no argv, no process.exit; `collectSpecs` reads the
|
|
83
|
+
* sidecar/manifest and writes the destination files):
|
|
84
|
+
* import { collectSpecs, injectControlRef, injectSourceSection } from "./collect-specs.mjs";
|
|
85
|
+
* const report = collectSpecs({ runDir, root }); // { root, total, verdict, areas: [{ idx, utgNodeId, count }] }
|
|
86
|
+
* collectSpecs({ runDir, root, replaceRoot: true }) // custom root: stage-and-swap
|
|
87
|
+
*/
|
|
88
|
+
import fs from "node:fs";
|
|
89
|
+
import path from "node:path";
|
|
90
|
+
import { fileURLToPath } from "node:url";
|
|
91
|
+
|
|
92
|
+
import {
|
|
93
|
+
readPublicationVerdict,
|
|
94
|
+
refusalMessage,
|
|
95
|
+
verdictSummary
|
|
96
|
+
} from "./publication-verdict.mjs";
|
|
97
|
+
|
|
98
|
+
const INTERACTION_DIRECTORY = "interaction";
|
|
99
|
+
const SPEC_DIRECTORY = "specs";
|
|
100
|
+
const SPEC_SUFFIX = "-SPEC.md";
|
|
101
|
+
const SIDECAR_FILENAME = "spec-bindings.json";
|
|
102
|
+
const MANIFEST_FILENAME = "manifest.json";
|
|
103
|
+
const GENERATION_DIRECTORY = "generation";
|
|
104
|
+
|
|
105
|
+
const H1_PATTERN = /^#\s/;
|
|
106
|
+
|
|
107
|
+
class UsageError extends Error {}
|
|
108
|
+
class CollectError extends Error {}
|
|
109
|
+
|
|
110
|
+
const DRAFT_FILENAME = "draft.json";
|
|
111
|
+
|
|
112
|
+
/** The publisher-owned provenance section, appended at the end of every published
|
|
113
|
+
* SPEC. Everything else in the body stays platform-neutral prose: a source path
|
|
114
|
+
* may appear ONLY inside this section, and only inside a bullet the gate's
|
|
115
|
+
* strict shape accepts. */
|
|
116
|
+
const SOURCE_SECTION_HEADING = /^##[ \t]+Source[ \t]+locations[ \t]*$/u;
|
|
117
|
+
const SOURCE_SECTION_ANYWHERE = /^##[ \t]+Source[ \t]+locations[ \t]*$/mu;
|
|
118
|
+
const SOURCE_SECTION_LABEL = "Source locations";
|
|
119
|
+
const SOURCE_SECTION_TITLE = `## ${SOURCE_SECTION_LABEL}`;
|
|
120
|
+
const OTHER_H2 = /^##[ \t]+/u;
|
|
121
|
+
/** The scenario heading whose label the section groups by: `## Scenario 1` /
|
|
122
|
+
* `## Scenario 1`. */
|
|
123
|
+
const SCENE_HEADING = /^##[ \t]+Scenario[ \t]+\d+[ \t]*$/u;
|
|
124
|
+
const WHOLE_PAGE_LABEL = "Whole page";
|
|
125
|
+
const BULLET_SEPARATOR = ", ";
|
|
126
|
+
const BULLET_LABEL_SEPARATOR = ": ";
|
|
127
|
+
/** One bullet stays readable: a SPEC with a dozen citations is split into
|
|
128
|
+
* several bullets that share a label, and a reader takes their union. */
|
|
129
|
+
const BULLET_BUDGET = 300;
|
|
130
|
+
|
|
131
|
+
/** The id a `<!-- behavior:<id> -->` marker claims, or undefined. A fresh
|
|
132
|
+
* literal per call: this test runs against every line of every SPEC. */
|
|
133
|
+
const BEHAVIOR_MARKER_ID = /^[ \t]*<!--[ \t]*behavior:([^\s>]+)[ \t]*-->[ \t]*$/u;
|
|
134
|
+
const behaviorMarkerIds = (markdown) =>
|
|
135
|
+
markdown.split(/\r?\n/).map((line) => BEHAVIOR_MARKER_ID.exec(line)?.[1]).filter((id) => id !== undefined);
|
|
136
|
+
|
|
137
|
+
/** Render one frozen-project anchor as `path:start-end` (a pre-baked library
|
|
138
|
+
* anchor carries `path` instead of `file`). Anything malformed is dropped: a
|
|
139
|
+
* published SPEC must never carry a reference a reader cannot open, and a space
|
|
140
|
+
* or backtick would break the bullet shape the gate validates. */
|
|
141
|
+
function formatAnchor(anchor) {
|
|
142
|
+
if (anchor === null || typeof anchor !== "object") return undefined;
|
|
143
|
+
const raw = typeof anchor.file === "string" && anchor.file.length > 0
|
|
144
|
+
? anchor.file
|
|
145
|
+
: typeof anchor.path === "string" && anchor.path.length > 0 ? anchor.path : undefined;
|
|
146
|
+
if (raw === undefined) return undefined;
|
|
147
|
+
const file = raw.replaceAll("\\", "/").trim();
|
|
148
|
+
if (file.length === 0 || /[\s>`]/.test(file)) return undefined;
|
|
149
|
+
const start = Number.isInteger(anchor.startLine) ? anchor.startLine : undefined;
|
|
150
|
+
if (start === undefined || start < 1) return undefined;
|
|
151
|
+
const end = Number.isInteger(anchor.endLine) && anchor.endLine > start ? anchor.endLine : start;
|
|
152
|
+
return end === start ? `${file}:${start}` : `${file}:${start}-${end}`;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/** `path:line` tokens for one anchor list, deduped, in draft order. */
|
|
156
|
+
function anchorTokens(anchors) {
|
|
157
|
+
const seen = new Set();
|
|
158
|
+
const tokens = [];
|
|
159
|
+
for (const anchor of anchors ?? []) {
|
|
160
|
+
const token = formatAnchor(anchor);
|
|
161
|
+
if (token === undefined || seen.has(token)) continue;
|
|
162
|
+
seen.add(token);
|
|
163
|
+
tokens.push(token);
|
|
164
|
+
}
|
|
165
|
+
return tokens;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/** `- <label>: `a:1-2`, `b:3`` bullets, wrapped at {@link BULLET_BUDGET}. The
|
|
169
|
+
* shape matters: the gate exempts a source path only inside a bullet matching
|
|
170
|
+
* it, so an over-long list is emitted as another full bullet rather than a bare
|
|
171
|
+
* continuation line. */
|
|
172
|
+
function renderBullets(label, tokens) {
|
|
173
|
+
const prefix = `- ${label}${BULLET_LABEL_SEPARATOR}`;
|
|
174
|
+
const out = [];
|
|
175
|
+
const seen = new Set();
|
|
176
|
+
let pieces = [];
|
|
177
|
+
let length = 0;
|
|
178
|
+
for (const token of tokens) {
|
|
179
|
+
// Anchors of several behaviours land in one label's list; two behaviours
|
|
180
|
+
// routinely share a line, so the union is deduped here, not per behaviour.
|
|
181
|
+
if (seen.has(token)) continue;
|
|
182
|
+
seen.add(token);
|
|
183
|
+
const piece = `\`${token}\``;
|
|
184
|
+
const added = pieces.length === 0 ? piece.length : BULLET_SEPARATOR.length + piece.length;
|
|
185
|
+
if (pieces.length > 0 && prefix.length + length + added > BULLET_BUDGET) {
|
|
186
|
+
out.push(prefix + pieces.join(BULLET_SEPARATOR));
|
|
187
|
+
pieces = [piece];
|
|
188
|
+
length = piece.length;
|
|
189
|
+
continue;
|
|
190
|
+
}
|
|
191
|
+
pieces.push(piece);
|
|
192
|
+
length += added;
|
|
193
|
+
}
|
|
194
|
+
if (pieces.length > 0) out.push(prefix + pieces.join(BULLET_SEPARATOR));
|
|
195
|
+
return out;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
/** Drop an existing `## Source locations` section so a re-collection replaces it instead
|
|
199
|
+
* of stacking a second copy. */
|
|
200
|
+
function stripSourceSection(lines) {
|
|
201
|
+
const start = lines.findIndex((line) => SOURCE_SECTION_HEADING.test(line));
|
|
202
|
+
if (start < 0) return lines;
|
|
203
|
+
let end = lines.length;
|
|
204
|
+
for (let i = start + 1; i < lines.length; i += 1) {
|
|
205
|
+
if (OTHER_H2.test(lines[i])) {
|
|
206
|
+
end = i;
|
|
207
|
+
break;
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
return [...lines.slice(0, start), ...lines.slice(end)];
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
/** Turn the worker's coverage markers into the published provenance section.
|
|
214
|
+
*
|
|
215
|
+
* The markers themselves never survive (downstream reads `behavior:` as worker
|
|
216
|
+
* output). Their draft-verified anchors are regrouped under one trailing
|
|
217
|
+
* `## Source locations` section: the record's own citations — plus any behaviour no
|
|
218
|
+
* scenario owned — become the `Whole page` bullet, and every other behaviour lands
|
|
219
|
+
* under the scenario heading it sat in. Position in the body therefore stops
|
|
220
|
+
* meaning anything; the label carries it. No evidence at all means no section,
|
|
221
|
+
* which is the batch-mode and lost-draft degradation path — and a section the
|
|
222
|
+
* worker wrote itself is removed rather than published.
|
|
223
|
+
*
|
|
224
|
+
* The anchors are the ones `interaction-finalize` already verified against the
|
|
225
|
+
* frozen source census, so this step adds no new claim — and no model call. */
|
|
226
|
+
export function injectSourceSection(markdown, evidence = {}) {
|
|
227
|
+
const newline = markdown.includes("\r\n") ? "\r\n" : "\n";
|
|
228
|
+
const anchorsById = evidence?.anchorsById ?? new Map();
|
|
229
|
+
const citations = anchorTokens(evidence?.citations);
|
|
230
|
+
// The section belongs to the publisher, so it is never trusted: whatever the
|
|
231
|
+
// worker wrote under that heading is dropped and rebuilt from the draft. This
|
|
232
|
+
// is what stands between a worker-authored `## Source locations` and a published SPEC
|
|
233
|
+
// whose paths nobody verified — the gate exempts the bullet SHAPE, not its
|
|
234
|
+
// origin. No evidence therefore means NO section, never a stale one.
|
|
235
|
+
const lines = stripSourceSection(markdown.split(/\r?\n/));
|
|
236
|
+
const byLabel = new Map();
|
|
237
|
+
const sceneLabels = [];
|
|
238
|
+
const body = [];
|
|
239
|
+
let scene;
|
|
240
|
+
for (const line of lines) {
|
|
241
|
+
if (SCENE_HEADING.test(line)) {
|
|
242
|
+
scene = line.replace(/^##[ \t]+/u, "").trim();
|
|
243
|
+
body.push(line);
|
|
244
|
+
continue;
|
|
245
|
+
}
|
|
246
|
+
const markerId = BEHAVIOR_MARKER_ID.exec(line)?.[1];
|
|
247
|
+
if (markerId !== undefined) {
|
|
248
|
+
const tokens = anchorTokens(anchorsById.get(markerId));
|
|
249
|
+
if (tokens.length > 0) {
|
|
250
|
+
const label = scene ?? WHOLE_PAGE_LABEL;
|
|
251
|
+
if (!byLabel.has(label)) byLabel.set(label, []);
|
|
252
|
+
byLabel.get(label).push(...tokens);
|
|
253
|
+
if (label !== WHOLE_PAGE_LABEL && !sceneLabels.includes(label)) sceneLabels.push(label);
|
|
254
|
+
}
|
|
255
|
+
continue;
|
|
256
|
+
}
|
|
257
|
+
body.push(line);
|
|
258
|
+
}
|
|
259
|
+
const bullets = [
|
|
260
|
+
...renderBullets(WHOLE_PAGE_LABEL, [...citations, ...(byLabel.get(WHOLE_PAGE_LABEL) ?? [])]),
|
|
261
|
+
...sceneLabels.flatMap((label) => renderBullets(label, byLabel.get(label)))
|
|
262
|
+
];
|
|
263
|
+
if (bullets.length === 0) {
|
|
264
|
+
const rebuilt = body.join(newline);
|
|
265
|
+
// Byte-for-byte when there was nothing to remove (batch mode, a lost draft):
|
|
266
|
+
// a step that changes nothing must not touch the file either.
|
|
267
|
+
return rebuilt === markdown ? markdown : rebuilt;
|
|
268
|
+
}
|
|
269
|
+
while (body.length > 0 && body[body.length - 1].trim() === "") body.pop();
|
|
270
|
+
return `${[...body, "", SOURCE_SECTION_TITLE, "", ...bullets].join(newline)}${newline}`;
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
/** Inject `Control: <controlRef>` as the line right after the H1. The sidecar's
|
|
274
|
+
* L2-minted controlRef is the single authority: a `Control: ` line already in the
|
|
275
|
+
* worker-authored file is stripped and replaced, never trusted — a forged
|
|
276
|
+
* identity must not survive into the publish root, because publish-specs reads
|
|
277
|
+
* the identity back out of the published file. `controlRef` absent/blank means
|
|
278
|
+
* "no identity to inject": also returned verbatim. */
|
|
279
|
+
export function injectControlRef(markdown, controlRef) {
|
|
280
|
+
if (typeof controlRef !== "string" || controlRef.length === 0) return markdown;
|
|
281
|
+
const newline = markdown.includes("\r\n") ? "\r\n" : "\n";
|
|
282
|
+
// Strip an existing identity line in either language (zh `Control: `, en `Control: `,
|
|
283
|
+
// case-sensitive — i18n/terms.json); the injected line below stays zh.
|
|
284
|
+
const stripped = markdown.split(/\r?\n/).filter((line) => !/^[ \t]*(?:Control:)/.test(line));
|
|
285
|
+
const h1 = stripped.findIndex((line) => H1_PATTERN.test(line));
|
|
286
|
+
if (h1 < 0) return markdown;
|
|
287
|
+
stripped.splice(h1 + 1, 0, `${"Control: "}${controlRef}`);
|
|
288
|
+
return stripped.join(newline);
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
/** Load the frozen draft next to an Area's SPECs: per-STEM citations and
|
|
292
|
+
* per-behaviour-id anchors are the only evidence the published comments may
|
|
293
|
+
* carry, because nothing later in the pipeline re-verifies a line number.
|
|
294
|
+
* Absent/unreadable ⇒ undefined, and publication degrades to the
|
|
295
|
+
* pre-traceability behaviour (markers stripped, no source line) instead of
|
|
296
|
+
* failing: a partial run collected with --allow-incomplete can lack drafts. */
|
|
297
|
+
function loadDraftEvidence(taskDir) {
|
|
298
|
+
let draft;
|
|
299
|
+
try {
|
|
300
|
+
draft = JSON.parse(fs.readFileSync(path.join(taskDir, DRAFT_FILENAME), "utf8"));
|
|
301
|
+
} catch {
|
|
302
|
+
return undefined;
|
|
303
|
+
}
|
|
304
|
+
const anchorsByBehaviorId = new Map();
|
|
305
|
+
for (const behavior of Array.isArray(draft?.behaviors) ? draft.behaviors : []) {
|
|
306
|
+
const id = behavior?.id;
|
|
307
|
+
if (typeof id !== "string" || id.length === 0) continue;
|
|
308
|
+
anchorsByBehaviorId.set(id, Array.isArray(behavior?.anchors) ? behavior.anchors : []);
|
|
309
|
+
}
|
|
310
|
+
const citationsByStem = new Map();
|
|
311
|
+
for (const record of Array.isArray(draft?.specs) ? draft.specs : []) {
|
|
312
|
+
const stem = record?.stem;
|
|
313
|
+
if (typeof stem !== "string" || stem.length === 0) continue;
|
|
314
|
+
citationsByStem.set(stem, Array.isArray(record?.citations) ? record.citations : []);
|
|
315
|
+
}
|
|
316
|
+
return { anchorsByBehaviorId, citationsByStem };
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
/** Assert the SPEC's H1 is verbatim `# <stem>SPEC` (the naming contract the
|
|
320
|
+
* fused task book and check-fused-spec enforce). */
|
|
321
|
+
function assertSpecH1(markdown, stem, specPath) {
|
|
322
|
+
const h1Line = markdown.split(/\r?\n/).find((line) => H1_PATTERN.test(line));
|
|
323
|
+
const expected = `# ${stem}SPEC`;
|
|
324
|
+
if (h1Line === undefined || h1Line.trim() !== expected) {
|
|
325
|
+
const found = h1Line === undefined ? "no H1" : `\`${h1Line.trim()}\``;
|
|
326
|
+
throw new CollectError(`${specPath}: H1 must be \`${expected}\`, found ${found}`);
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
/** `utgNodeId` → task directory, from `interaction/manifest.json`. The sidecar's
|
|
331
|
+
* frozen UTG node id is the manifest Area's `expected.areaRef`; the task
|
|
332
|
+
* directory is `dirname(<runDir>/<expected.outputPath>)`, resolved the same way
|
|
333
|
+
* reqgen's `model/query.ts` (backslash-normalised, segment-wise, inside the run). */
|
|
334
|
+
function loadTaskDirs(runDir) {
|
|
335
|
+
const manifestPath = path.join(runDir, INTERACTION_DIRECTORY, MANIFEST_FILENAME);
|
|
336
|
+
let manifest;
|
|
337
|
+
try {
|
|
338
|
+
manifest = JSON.parse(fs.readFileSync(manifestPath, "utf8"));
|
|
339
|
+
} catch (error) {
|
|
340
|
+
throw new CollectError(
|
|
341
|
+
`cannot read ${manifestPath}: ${error?.code ?? error?.message}`
|
|
342
|
+
);
|
|
343
|
+
}
|
|
344
|
+
const plans = Array.isArray(manifest?.areaPlans) ? manifest.areaPlans : [];
|
|
345
|
+
const byAreaRef = new Map();
|
|
346
|
+
for (const plan of plans) {
|
|
347
|
+
const expected = plan?.expected ?? {};
|
|
348
|
+
const areaRef = expected.areaRef;
|
|
349
|
+
const outputPath = expected.outputPath;
|
|
350
|
+
if (typeof areaRef !== "string" || areaRef.length === 0) continue;
|
|
351
|
+
if (typeof outputPath !== "string" || outputPath.length === 0) continue;
|
|
352
|
+
const target = path.resolve(runDir, ...outputPath.replaceAll("\\", "/").split("/"));
|
|
353
|
+
const relative = path.relative(runDir, target);
|
|
354
|
+
if (
|
|
355
|
+
relative === "" ||
|
|
356
|
+
relative === ".." ||
|
|
357
|
+
relative.startsWith(`..${path.sep}`) ||
|
|
358
|
+
path.isAbsolute(relative)
|
|
359
|
+
) {
|
|
360
|
+
throw new CollectError(
|
|
361
|
+
`manifest areaPlan "${areaRef}" expected.outputPath escapes the run directory: ${outputPath}`
|
|
362
|
+
);
|
|
363
|
+
}
|
|
364
|
+
byAreaRef.set(areaRef, path.dirname(target));
|
|
365
|
+
}
|
|
366
|
+
return byAreaRef;
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
function defaultRootFor(run) {
|
|
370
|
+
return path.join(run, GENERATION_DIRECTORY, SPEC_DIRECTORY);
|
|
371
|
+
}
|
|
372
|
+
|
|
373
|
+
/** Windows path comparison is case-insensitive; the default root may not exist yet. */
|
|
374
|
+
function comparablePath(value) {
|
|
375
|
+
const resolved = path.resolve(value);
|
|
376
|
+
return process.platform === "win32" ? resolved.toLowerCase() : resolved;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
function samePath(left, right) {
|
|
380
|
+
return comparablePath(left) === comparablePath(right);
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
/** Legacy custom-root behaviour: write each file in place, never touch anything else. */
|
|
384
|
+
function writeInPlace(root, files) {
|
|
385
|
+
for (const file of files) {
|
|
386
|
+
const destination = path.join(root, ...file.segments);
|
|
387
|
+
fs.mkdirSync(path.dirname(destination), { recursive: true });
|
|
388
|
+
fs.writeFileSync(destination, file.content, "utf8");
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
/**
|
|
393
|
+
* Build the whole root in a sibling staging directory, then swap it in. Nothing
|
|
394
|
+
* under the old root survives, so a changed sidecar (new/removed Area, shifted
|
|
395
|
+
* idx) cannot leave a stale `*-SPEC.md` for `publish-specs` to re-publish.
|
|
396
|
+
*
|
|
397
|
+
* The rename to a backup is the rollback path: if the second rename fails, the
|
|
398
|
+
* old root is restored and the caller sees the write error. The staging
|
|
399
|
+
* directory is removed on every exit path.
|
|
400
|
+
*/
|
|
401
|
+
function stageAndSwap(root, files) {
|
|
402
|
+
const parent = path.dirname(root);
|
|
403
|
+
fs.mkdirSync(parent, { recursive: true });
|
|
404
|
+
const staging = fs.mkdtempSync(path.join(parent, ".collect-specs-staging-"));
|
|
405
|
+
try {
|
|
406
|
+
for (const file of files) {
|
|
407
|
+
const destination = path.join(staging, ...file.segments);
|
|
408
|
+
fs.mkdirSync(path.dirname(destination), { recursive: true });
|
|
409
|
+
fs.writeFileSync(destination, file.content, "utf8");
|
|
410
|
+
}
|
|
411
|
+
const backup = `${root}.backup-${process.pid}-${Date.now()}`;
|
|
412
|
+
const hadRoot = fs.existsSync(root);
|
|
413
|
+
if (hadRoot) fs.renameSync(root, backup);
|
|
414
|
+
try {
|
|
415
|
+
fs.renameSync(staging, root);
|
|
416
|
+
} catch (error) {
|
|
417
|
+
if (hadRoot) {
|
|
418
|
+
try {
|
|
419
|
+
fs.renameSync(backup, root);
|
|
420
|
+
} catch {
|
|
421
|
+
/* restore failed: surface the original write error and keep the backup */
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
throw error;
|
|
425
|
+
}
|
|
426
|
+
if (hadRoot) {
|
|
427
|
+
try {
|
|
428
|
+
fs.rmSync(backup, { recursive: true, force: true });
|
|
429
|
+
} catch {
|
|
430
|
+
/* the new root is already in place; a leftover backup is harmless */
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
} finally {
|
|
434
|
+
fs.rmSync(staging, { recursive: true, force: true });
|
|
435
|
+
}
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
/** Read the sidecar and relocate every declared SPEC. Returns the per-`idx`
|
|
439
|
+
* summary; throws {@link CollectError} on any missing/mismatched SPEC or when the
|
|
440
|
+
* run's publication gate refuses it (unless `allowIncomplete`).
|
|
441
|
+
*
|
|
442
|
+
* `replaceRoot` defaults to true for the run's own publish root
|
|
443
|
+
* (`<runDir>/generation/specs`) and false for a custom root, which keeps the
|
|
444
|
+
* legacy in-place behaviour unless the caller explicitly opts in. */
|
|
445
|
+
export function collectSpecs({ runDir, root, allowIncomplete = false, replaceRoot } = {}) {
|
|
446
|
+
const run = path.resolve(runDir);
|
|
447
|
+
const verdict = readPublicationVerdict(run);
|
|
448
|
+
const refusal = refusalMessage(verdict, "collect-specs");
|
|
449
|
+
if (refusal !== null && !allowIncomplete) {
|
|
450
|
+
throw new CollectError(refusal);
|
|
451
|
+
}
|
|
452
|
+
const sidecarPath = path.join(run, GENERATION_DIRECTORY, SIDECAR_FILENAME);
|
|
453
|
+
let sidecar;
|
|
454
|
+
try {
|
|
455
|
+
sidecar = JSON.parse(fs.readFileSync(sidecarPath, "utf8"));
|
|
456
|
+
} catch (error) {
|
|
457
|
+
throw new CollectError(
|
|
458
|
+
`cannot read ${sidecarPath}: ${error?.code ?? error?.message}`
|
|
459
|
+
);
|
|
460
|
+
}
|
|
461
|
+
if (!Array.isArray(sidecar?.areas)) {
|
|
462
|
+
throw new CollectError(`${sidecarPath}: missing areas[]`);
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
const taskDirByUtgNodeId = loadTaskDirs(run);
|
|
466
|
+
const outputRoot = path.resolve(root || defaultRootFor(run));
|
|
467
|
+
const shouldReplace = replaceRoot === undefined
|
|
468
|
+
? samePath(outputRoot, defaultRootFor(run))
|
|
469
|
+
: Boolean(replaceRoot);
|
|
470
|
+
const areas = [];
|
|
471
|
+
// Render every SPEC before touching the destination: a validation failure must
|
|
472
|
+
// leave the previous publish root exactly as it was.
|
|
473
|
+
const files = [];
|
|
474
|
+
let total = 0;
|
|
475
|
+
// A sidecar entry can fold several drafts, so the same task dir is read for
|
|
476
|
+
// more than one stem; the draft is parsed once per Area.
|
|
477
|
+
const provenance = { withSourceSection: [], withoutSourceSection: [], behaviorsWithoutAnchors: [], draftMissing: [] };
|
|
478
|
+
const draftByTaskDir = new Map();
|
|
479
|
+
const evidenceFor = (taskDir) => {
|
|
480
|
+
if (!draftByTaskDir.has(taskDir)) draftByTaskDir.set(taskDir, loadDraftEvidence(taskDir));
|
|
481
|
+
return draftByTaskDir.get(taskDir);
|
|
482
|
+
};
|
|
483
|
+
|
|
484
|
+
sidecar.areas.forEach((area, index) => {
|
|
485
|
+
const idx = index + 1;
|
|
486
|
+
const areaUtgNodeId = area?.utgNodeId;
|
|
487
|
+
if (typeof areaUtgNodeId !== "string" || areaUtgNodeId.length === 0) {
|
|
488
|
+
throw new CollectError(`${sidecarPath}: areas[${index}] is missing utgNodeId`);
|
|
489
|
+
}
|
|
490
|
+
const specs = Array.isArray(area.specs) ? area.specs : [];
|
|
491
|
+
let count = 0;
|
|
492
|
+
// One destination name per idx: a sidecar entry can fold several drafts, and
|
|
493
|
+
// two of them declaring the same stem would make the later write silently
|
|
494
|
+
// overwrite the earlier SPEC (`<idx>/<stem>-SPEC.md`). The Model side already
|
|
495
|
+
// drops such a binding with a diagnostic, so this guard is the last line of
|
|
496
|
+
// defence for hand-made or older sidecars — the colliding write is refused
|
|
497
|
+
// before it happens.
|
|
498
|
+
const originByDestination = new Map();
|
|
499
|
+
for (const [specIndex, spec] of specs.entries()) {
|
|
500
|
+
const stem = spec?.stem;
|
|
501
|
+
if (typeof stem !== "string" || stem.length === 0) {
|
|
502
|
+
throw new CollectError(`${sidecarPath}: areas[${index}].specs[${specIndex}] is missing stem`);
|
|
503
|
+
}
|
|
504
|
+
if (/[\\/]/.test(stem)) {
|
|
505
|
+
throw new CollectError(
|
|
506
|
+
`${sidecarPath}: areas[${index}].specs[${specIndex}].stem must be a single path segment: ${JSON.stringify(stem)}`
|
|
507
|
+
);
|
|
508
|
+
}
|
|
509
|
+
// Each SPEC resolves its OWN task dir. A sidecar entry can fold several
|
|
510
|
+
// drafts (a supporting Area folds into its primary), so the entry's
|
|
511
|
+
// `utgNodeId` is only the fallback for an older sidecar that predates the
|
|
512
|
+
// per-binding field.
|
|
513
|
+
const ownerUtgNodeId =
|
|
514
|
+
typeof spec.utgNodeId === "string" && spec.utgNodeId.length > 0
|
|
515
|
+
? spec.utgNodeId
|
|
516
|
+
: areaUtgNodeId;
|
|
517
|
+
const taskDir = taskDirByUtgNodeId.get(ownerUtgNodeId);
|
|
518
|
+
if (taskDir === undefined) {
|
|
519
|
+
throw new CollectError(
|
|
520
|
+
`no interaction/${MANIFEST_FILENAME} areaPlans[] entry with ` +
|
|
521
|
+
`expected.areaRef === ${JSON.stringify(ownerUtgNodeId)} ` +
|
|
522
|
+
`(areas[${index}].specs[${specIndex}], idx ${idx})`
|
|
523
|
+
);
|
|
524
|
+
}
|
|
525
|
+
const destinationName = `${stem}${SPEC_SUFFIX}`;
|
|
526
|
+
const previous = originByDestination.get(destinationName);
|
|
527
|
+
if (previous !== undefined) {
|
|
528
|
+
throw new CollectError(
|
|
529
|
+
`${sidecarPath}: areas[${index}].specs[${previous.specIndex}] (${previous.ownerUtgNodeId}) and ` +
|
|
530
|
+
`areas[${index}].specs[${specIndex}] (${ownerUtgNodeId}) both declare ${destinationName} — ` +
|
|
531
|
+
`the later write would silently overwrite ${path.join(outputRoot, String(idx), destinationName)}. ` +
|
|
532
|
+
'Give one of the two SPECs a collision suffix ("-2", "-3", …) and re-run the worker gate + finalize.'
|
|
533
|
+
);
|
|
534
|
+
}
|
|
535
|
+
originByDestination.set(destinationName, { specIndex, ownerUtgNodeId });
|
|
536
|
+
const sourcePath = path.join(taskDir, SPEC_DIRECTORY, `${stem}${SPEC_SUFFIX}`);
|
|
537
|
+
const evidence = evidenceFor(taskDir);
|
|
538
|
+
if (evidence === undefined) provenance.draftMissing.push(`${idx}/${stem}`);
|
|
539
|
+
let markdown;
|
|
540
|
+
let markerIds;
|
|
541
|
+
try {
|
|
542
|
+
// Strip a UTF-8 BOM (Windows editors save with one) before line checks,
|
|
543
|
+
// and turn the fused worker's coverage markers into publisher-owned
|
|
544
|
+
// provenance section (or drop them when the draft proves no anchor).
|
|
545
|
+
const raw = fs.readFileSync(sourcePath, "utf8").replace(/^\uFEFF/, "");
|
|
546
|
+
markerIds = behaviorMarkerIds(raw);
|
|
547
|
+
markdown = injectSourceSection(raw, {
|
|
548
|
+
citations: evidence?.citationsByStem.get(stem),
|
|
549
|
+
anchorsById: evidence?.anchorsByBehaviorId
|
|
550
|
+
});
|
|
551
|
+
} catch (error) {
|
|
552
|
+
throw new CollectError(
|
|
553
|
+
`${sidecarPath}: areas[${index}].specs[${specIndex}] declares ${stem}${SPEC_SUFFIX}, ` +
|
|
554
|
+
`but it is not readable: ${sourcePath} (${error?.code ?? error?.message})`
|
|
555
|
+
);
|
|
556
|
+
}
|
|
557
|
+
assertSpecH1(markdown, stem, sourcePath);
|
|
558
|
+
const controlRef = typeof spec.controlRef === "string" && spec.controlRef.length > 0
|
|
559
|
+
? spec.controlRef
|
|
560
|
+
: undefined;
|
|
561
|
+
const content = injectControlRef(markdown, controlRef);
|
|
562
|
+
// Ground truth, not a re-derivation: read what actually landed in the file.
|
|
563
|
+
const sourced = SOURCE_SECTION_ANYWHERE.test(content);
|
|
564
|
+
(sourced ? provenance.withSourceSection : provenance.withoutSourceSection).push(`${idx}/${stem}`);
|
|
565
|
+
for (const id of markerIds) {
|
|
566
|
+
if (!(evidence?.anchorsByBehaviorId?.get(id)?.length > 0)) provenance.behaviorsWithoutAnchors.push(id);
|
|
567
|
+
}
|
|
568
|
+
files.push({ segments: [String(idx), `${stem}${SPEC_SUFFIX}`], content });
|
|
569
|
+
count += 1;
|
|
570
|
+
}
|
|
571
|
+
total += count;
|
|
572
|
+
areas.push({ idx, utgNodeId: areaUtgNodeId, count });
|
|
573
|
+
});
|
|
574
|
+
|
|
575
|
+
if (shouldReplace) stageAndSwap(outputRoot, files);
|
|
576
|
+
else writeInPlace(outputRoot, files);
|
|
577
|
+
|
|
578
|
+
return { root: outputRoot, total, verdict, areas, provenance };
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
function usage(stream) {
|
|
582
|
+
stream.write(
|
|
583
|
+
"Usage: node collect-specs.mjs --run <runDir> [--root <specOutputRoot>]\n" +
|
|
584
|
+
" [--allow-incomplete] [--replace-root]\n" +
|
|
585
|
+
"\n" +
|
|
586
|
+
"Collects the fused worker's per-Area SPECs from the spec-bindings sidecar\n" +
|
|
587
|
+
"into <root>/<idx>/<stem>-SPEC.md, injecting each SPEC's Control identity.\n" +
|
|
588
|
+
"Defaults --root to <runDir>/generation/specs and replaces that directory as\n" +
|
|
589
|
+
"a whole (staged, then swapped), so an earlier sidecar's SPECs cannot linger.\n" +
|
|
590
|
+
"\n" +
|
|
591
|
+
"A custom --root is written in place to avoid destroying a caller-owned tree;\n" +
|
|
592
|
+
"--replace-root opts a custom root into the same stage-and-swap (destructive).\n" +
|
|
593
|
+
"\n" +
|
|
594
|
+
"The run's run-report.json must be a completed, publishable finalize; a run\n" +
|
|
595
|
+
"that is not (an Area that never finalized, or a candidate no Area owns) is\n" +
|
|
596
|
+
"refused unless --allow-incomplete, which says which one it was.\n"
|
|
597
|
+
);
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
function parseArgs(argv) {
|
|
601
|
+
const options = { run: undefined, root: undefined, allowIncomplete: false, replaceRoot: undefined, help: false };
|
|
602
|
+
for (let i = 0; i < argv.length; i += 1) {
|
|
603
|
+
const argument = argv[i];
|
|
604
|
+
const take = () => {
|
|
605
|
+
const value = argv[++i];
|
|
606
|
+
if (value === undefined || value.startsWith("--")) {
|
|
607
|
+
throw new UsageError(`${argument} requires a path`);
|
|
608
|
+
}
|
|
609
|
+
return value;
|
|
610
|
+
};
|
|
611
|
+
if (argument === "--run") options.run = take();
|
|
612
|
+
else if (argument === "--root") options.root = take();
|
|
613
|
+
else if (argument === "--allow-incomplete") options.allowIncomplete = true;
|
|
614
|
+
else if (argument === "--replace-root") options.replaceRoot = true;
|
|
615
|
+
else if (argument === "--help" || argument === "-h") options.help = true;
|
|
616
|
+
else throw new UsageError(`unknown argument '${argument}'`);
|
|
617
|
+
}
|
|
618
|
+
return options;
|
|
619
|
+
}
|
|
620
|
+
|
|
621
|
+
/** A warning must name what went wrong without pasting 731 ids into the log. */
|
|
622
|
+
const preview = (items, limit = 10) =>
|
|
623
|
+
items.length <= limit
|
|
624
|
+
? items.join(", ")
|
|
625
|
+
: `${items.slice(0, limit).join(", ")} …and ${items.length - limit} more`;
|
|
626
|
+
|
|
627
|
+
function main() {
|
|
628
|
+
let options;
|
|
629
|
+
try {
|
|
630
|
+
options = parseArgs(process.argv.slice(2));
|
|
631
|
+
} catch (error) {
|
|
632
|
+
if (error instanceof UsageError) {
|
|
633
|
+
process.stderr.write(`collect-specs: ${error.message}\n`);
|
|
634
|
+
usage(process.stderr);
|
|
635
|
+
process.exit(2);
|
|
636
|
+
}
|
|
637
|
+
throw error;
|
|
638
|
+
}
|
|
639
|
+
if (options.help) {
|
|
640
|
+
usage(process.stdout);
|
|
641
|
+
return;
|
|
642
|
+
}
|
|
643
|
+
if (!options.run) {
|
|
644
|
+
process.stderr.write("collect-specs: missing --run <runDir>\n");
|
|
645
|
+
usage(process.stderr);
|
|
646
|
+
process.exit(2);
|
|
647
|
+
}
|
|
648
|
+
const runDir = path.resolve(options.run);
|
|
649
|
+
if (!fs.existsSync(runDir) || !fs.statSync(runDir).isDirectory()) {
|
|
650
|
+
process.stderr.write(`collect-specs: --run is not a directory: '${runDir}'\n`);
|
|
651
|
+
process.exit(2);
|
|
652
|
+
}
|
|
653
|
+
const root = options.root ? path.resolve(options.root) : path.join(runDir, GENERATION_DIRECTORY, SPEC_DIRECTORY);
|
|
654
|
+
let report;
|
|
655
|
+
try {
|
|
656
|
+
report = collectSpecs({
|
|
657
|
+
runDir,
|
|
658
|
+
root,
|
|
659
|
+
allowIncomplete: options.allowIncomplete,
|
|
660
|
+
replaceRoot: options.replaceRoot,
|
|
661
|
+
});
|
|
662
|
+
} catch (error) {
|
|
663
|
+
if (error instanceof CollectError) {
|
|
664
|
+
process.stderr.write(`[collect-specs] ${error.message}\n`);
|
|
665
|
+
process.exit(1);
|
|
666
|
+
}
|
|
667
|
+
throw error;
|
|
668
|
+
}
|
|
669
|
+
process.stdout.write(`collect-specs: ${report.root}\n`);
|
|
670
|
+
if (report.verdict.state === "complete") {
|
|
671
|
+
process.stdout.write(" run: publishable (run-report.json is complete)\n");
|
|
672
|
+
} else {
|
|
673
|
+
process.stdout.write(
|
|
674
|
+
` run: NOT publishable — ${verdictSummary(report.verdict)} ` +
|
|
675
|
+
"(--allow-incomplete was used; this collection is partial)\n"
|
|
676
|
+
);
|
|
677
|
+
}
|
|
678
|
+
for (const area of report.areas) {
|
|
679
|
+
process.stdout.write(` idx ${area.idx}: ${area.count} SPECs (${area.utgNodeId})\n`);
|
|
680
|
+
}
|
|
681
|
+
process.stdout.write(` total: ${report.total} SPECs across ${report.areas.length} Areas\n`);
|
|
682
|
+
const { provenance } = report;
|
|
683
|
+
const sourced = provenance.withSourceSection.length;
|
|
684
|
+
process.stdout.write(
|
|
685
|
+
` provenance: ${sourced}/${report.total} SPECs carry a ${SOURCE_SECTION_LABEL} section` +
|
|
686
|
+
`, ${provenance.behaviorsWithoutAnchors.length} behaviour anchor(s) unavailable\n`
|
|
687
|
+
);
|
|
688
|
+
// Loud on purpose: a SPEC that silently loses its provenance cannot be traced
|
|
689
|
+
// back afterwards, and nothing downstream would ever complain.
|
|
690
|
+
const warn = (message) => process.stdout.write(` [warn] ${message}\n`);
|
|
691
|
+
if (provenance.draftMissing.length > 0) {
|
|
692
|
+
warn(
|
|
693
|
+
`no ${DRAFT_FILENAME} for ${provenance.draftMissing.length} Area binding(s) — ` +
|
|
694
|
+
`their behaviour markers were removed instead of annotated: ${preview(provenance.draftMissing)}`
|
|
695
|
+
);
|
|
696
|
+
}
|
|
697
|
+
if (provenance.withoutSourceSection.length > 0) {
|
|
698
|
+
warn(
|
|
699
|
+
`${provenance.withoutSourceSection.length} SPEC(s) published with NO ${SOURCE_SECTION_LABEL} section: ` +
|
|
700
|
+
preview(provenance.withoutSourceSection)
|
|
701
|
+
);
|
|
702
|
+
}
|
|
703
|
+
if (provenance.behaviorsWithoutAnchors.length > 0) {
|
|
704
|
+
warn(
|
|
705
|
+
`${provenance.behaviorsWithoutAnchors.length} behaviour marker(s) had no verified anchor in the ` +
|
|
706
|
+
`draft and were dropped rather than annotated: ${preview(provenance.behaviorsWithoutAnchors)}`
|
|
707
|
+
);
|
|
708
|
+
}
|
|
709
|
+
}
|
|
710
|
+
|
|
711
|
+
/**
|
|
712
|
+
* Fail closed: when this file is *executed* — even through a symlinked or
|
|
713
|
+
* space-containing path (the skill invokes it by absolute path) — the guard must
|
|
714
|
+
* be true. Node realpaths `import.meta.url` but not `process.argv[1]`, so compare
|
|
715
|
+
* realpaths explicitly; on any failure assume "not the entry" (a library import),
|
|
716
|
+
* so importing this module is an intentional silent no-op.
|
|
717
|
+
*/
|
|
718
|
+
const isEntryPoint = (() => {
|
|
719
|
+
try {
|
|
720
|
+
return Boolean(process.argv[1]) &&
|
|
721
|
+
fs.realpathSync(process.argv[1]) === fs.realpathSync(fileURLToPath(import.meta.url));
|
|
722
|
+
} catch {
|
|
723
|
+
return false;
|
|
724
|
+
}
|
|
725
|
+
})();
|
|
726
|
+
|
|
727
|
+
if (isEntryPoint) main();
|