@buaa_smat/hometrans 0.1.19 → 26.0.0-devecocli.2
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/agents/build-fixer.md +406 -0
- package/agents/code-reviewer.md +461 -496
- package/agents/model-render-worker.md +34 -0
- package/agents/model-worker.md +23 -0
- package/agents/specgen-worker.md +18 -0
- package/commands/hometrans.md +17 -0
- package/devecocli-plugin/common.ts +2203 -0
- package/devecocli-plugin/install.ts +61 -0
- package/devecocli-plugin/uninstall.ts +26 -0
- package/devecocli-plugin/update.ts +66 -0
- package/index.js +1418 -0
- package/package.json +81 -66
- package/platforms/atomcode/agents/build-fixer.frontmatter.md +6 -0
- package/platforms/atomcode/agents/code-reviewer.frontmatter.md +6 -0
- package/platforms/atomcode/agents/model-render-worker.frontmatter.md +6 -0
- package/platforms/atomcode/agents/model-worker.frontmatter.md +6 -0
- package/platforms/atomcode/agents/specgen-worker.frontmatter.md +6 -0
- package/platforms/deveco/agents/build-fixer.frontmatter.md +5 -0
- package/platforms/deveco/agents/code-reviewer.frontmatter.md +5 -0
- package/platforms/deveco/agents/model-render-worker.frontmatter.md +5 -0
- package/platforms/deveco/agents/model-worker.frontmatter.md +5 -0
- package/platforms/deveco/agents/specgen-worker.frontmatter.md +5 -0
- package/platforms/opencode/agents/build-fixer.frontmatter.md +5 -0
- package/platforms/opencode/agents/code-reviewer.frontmatter.md +5 -0
- package/platforms/opencode/agents/model-render-worker.frontmatter.md +5 -0
- package/platforms/opencode/agents/model-worker.frontmatter.md +5 -0
- package/platforms/opencode/agents/specgen-worker.frontmatter.md +5 -0
- package/plugin.jsonc +12 -0
- package/skills/a2h-app-migrate/SKILL.md +181 -0
- package/skills/a2h-app-migrate/references/config.example.json +27 -0
- package/skills/a2h-app-migrate/references/specs.example.json +19 -0
- package/skills/a2h-app-migrate/references/stage-map.md +33 -0
- package/skills/a2h-app-migrate/references/workflow.yaml +1600 -0
- package/skills/a2h-app-migrate/scripts/android_index.mjs +109 -0
- package/skills/a2h-app-migrate/scripts/check_arch_done.mjs +80 -0
- package/skills/a2h-app-migrate/scripts/check_module_docs_done.mjs +95 -0
- package/skills/a2h-app-migrate/scripts/check_signing.mjs +152 -0
- package/skills/a2h-app-migrate/scripts/check_spec_gen_done.mjs +114 -0
- package/skills/a2h-app-migrate/scripts/check_spec_pipeline_done.mjs +277 -0
- package/skills/a2h-app-migrate/scripts/check_ui_batch_done.mjs +77 -0
- package/skills/a2h-app-migrate/scripts/check_utg_static_done.mjs +147 -0
- package/skills/a2h-app-migrate/scripts/cli_values.mjs +32 -0
- package/skills/a2h-app-migrate/scripts/env_preflight.mjs +1388 -0
- package/skills/a2h-app-migrate/scripts/human_review_gate.mjs +651 -0
- package/skills/a2h-app-migrate/scripts/infer_android_root.mjs +53 -0
- package/skills/a2h-app-migrate/scripts/json_io.mjs +35 -0
- package/skills/a2h-app-migrate/scripts/ledger.mjs +104 -0
- package/skills/a2h-app-migrate/scripts/lib-yaml-lite.mjs +288 -0
- package/skills/a2h-app-migrate/scripts/paths_preflight.mjs +713 -0
- package/skills/a2h-app-migrate/scripts/resume_plan.mjs +205 -0
- package/skills/a2h-app-migrate/scripts/reuse_static_utg.mjs +121 -0
- package/skills/a2h-app-migrate/scripts/run_dir.mjs +212 -0
- package/skills/a2h-app-migrate/scripts/spec_layout.mjs +30 -0
- package/skills/a2h-app-migrate/scripts/validate_workflow.mjs +455 -0
- package/skills/a2h-app-migrate/test/test_android_index.mjs +80 -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 +92 -0
- package/skills/a2h-app-migrate/test/test_config_example.mjs +42 -0
- package/skills/a2h-app-migrate/test/test_entry_guards.mjs +93 -0
- package/skills/a2h-app-migrate/test/test_env_requirements.mjs +505 -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_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 +109 -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 +83 -0
- package/skills/a2h-app-migrate/test/test_resume_plan.mjs +144 -0
- package/skills/a2h-app-migrate/test/test_reuse_static_utg.mjs +100 -0
- package/skills/a2h-app-migrate/test/test_run_dir.mjs +315 -0
- package/skills/a2h-app-migrate/test/test_skill_doc.mjs +133 -0
- package/skills/a2h-app-migrate/test/test_spec_gen_done.mjs +133 -0
- package/skills/a2h-app-migrate/test/test_spec_gen_gate.mjs +158 -0
- package/skills/a2h-app-migrate/test/test_spec_pipeline_done.mjs +181 -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_utg_dirs.mjs +39 -0
- package/skills/a2h-app-migrate/test/test_utg_static_done.mjs +168 -0
- package/skills/a2h-app-migrate/test/test_validate_races.mjs +50 -0
- package/skills/a2h-arch-generate/SKILL.md +375 -0
- package/skills/a2h-arch-generate/examples/reconcile-existing-project.md +107 -0
- package/skills/a2h-arch-generate/examples/simple-conversion-android.md +103 -0
- package/skills/a2h-arch-generate/examples/simple-conversion-backend.md +70 -0
- package/skills/a2h-arch-generate/examples/simple-conversion-uniapp.md +106 -0
- package/skills/a2h-arch-generate/references/artifact-contracts.generate.md +120 -0
- package/skills/a2h-arch-generate/references/artifact-contracts.reconcile.md +123 -0
- package/skills/a2h-arch-generate/references/bpta-layered-architecture-design.md +88 -0
- package/skills/a2h-arch-generate/references/clustering-guidance.md +33 -0
- package/skills/a2h-arch-generate/references/database-schema-recovery.md +107 -0
- package/skills/a2h-arch-generate/references/existing-target-annotation.md +68 -0
- package/skills/a2h-arch-generate/references/harmony-project-inspection.md +150 -0
- package/skills/a2h-arch-generate/references/harmony-target-architecture.md +94 -0
- package/skills/a2h-arch-generate/references/homegraph-workflow.md +120 -0
- package/skills/a2h-arch-generate/references/module-evidence-subagent.md +45 -0
- package/skills/a2h-arch-generate/references/reconciliation-model.md +204 -0
- package/skills/a2h-arch-generate/references/scope-policy.md +28 -0
- package/skills/a2h-arch-generate/references/semantic-review.md +65 -0
- package/skills/a2h-arch-generate/references/source-baseline.md +93 -0
- package/skills/a2h-arch-generate/references/source-ecosystems.md +54 -0
- package/skills/a2h-arch-generate/references/transformation-model.md +78 -0
- package/skills/a2h-arch-generate/scripts/check_module_staleness.mjs +284 -0
- package/skills/a2h-arch-generate/scripts/cleanup_intermediates.mjs +260 -0
- package/skills/a2h-arch-generate/scripts/compute_processing_order.mjs +325 -0
- package/skills/a2h-arch-generate/scripts/create_project.mjs +149 -0
- package/skills/a2h-arch-generate/scripts/dump_core_facts.mjs +151 -0
- package/skills/a2h-arch-generate/scripts/extract_core_components.mjs +167 -0
- package/skills/a2h-arch-generate/scripts/generate_source_baseline.mjs +363 -0
- package/skills/a2h-arch-generate/scripts/generate_state.mjs +60 -0
- package/skills/a2h-arch-generate/scripts/inspect_and_route.mjs +326 -0
- package/skills/a2h-arch-generate/scripts/inspect_android_project.mjs +3739 -0
- package/skills/a2h-arch-generate/scripts/inspect_harmony_target.mjs +800 -0
- package/skills/a2h-arch-generate/scripts/inspect_project.mjs +251 -0
- package/skills/a2h-arch-generate/scripts/inspect_uniapp_project.mjs +809 -0
- package/skills/a2h-arch-generate/scripts/lib/py_compat.mjs +1454 -0
- package/skills/a2h-arch-generate/scripts/module_create/create.mjs +136 -0
- package/skills/a2h-arch-generate/scripts/module_create/generate.mjs +636 -0
- package/skills/a2h-arch-generate/scripts/module_create/hap/build-profile.json5 +33 -0
- package/skills/a2h-arch-generate/scripts/module_create/hap/hvigorfile.ts +6 -0
- package/skills/a2h-arch-generate/scripts/module_create/hap/obfuscation-rules.txt +23 -0
- package/skills/a2h-arch-generate/scripts/module_create/hap/oh-package.json5 +10 -0
- package/skills/a2h-arch-generate/scripts/module_create/hap/src/main/ets/applicationability/ApplicationAbility.ets +43 -0
- package/skills/a2h-arch-generate/scripts/module_create/hap/src/main/ets/pages/Index.ets +23 -0
- package/skills/a2h-arch-generate/scripts/module_create/hap/src/main/module.json5 +26 -0
- package/skills/a2h-arch-generate/scripts/module_create/hap/src/main/resources/base/element/color.json +8 -0
- package/skills/a2h-arch-generate/scripts/module_create/hap/src/main/resources/base/element/float.json +8 -0
- package/skills/a2h-arch-generate/scripts/module_create/hap/src/main/resources/base/element/string.json +16 -0
- package/skills/a2h-arch-generate/scripts/module_create/hap/src/main/resources/base/media/background.png +0 -0
- package/skills/a2h-arch-generate/scripts/module_create/hap/src/main/resources/base/media/foreground.png +0 -0
- package/skills/a2h-arch-generate/scripts/module_create/hap/src/main/resources/base/media/layered_image.json +7 -0
- package/skills/a2h-arch-generate/scripts/module_create/hap/src/main/resources/base/media/startIcon.png +0 -0
- package/skills/a2h-arch-generate/scripts/module_create/hap/src/main/resources/base/profile/main_pages.json +5 -0
- package/skills/a2h-arch-generate/scripts/module_create/hap/src/mock/mock-config.json5 +2 -0
- package/skills/a2h-arch-generate/scripts/module_create/hap/src/ohosTest/ets/test/Ability.test.ets +35 -0
- package/skills/a2h-arch-generate/scripts/module_create/hap/src/ohosTest/ets/test/List.test.ets +5 -0
- package/skills/a2h-arch-generate/scripts/module_create/hap/src/ohosTest/module.json5 +11 -0
- package/skills/a2h-arch-generate/scripts/module_create/hap/src/test/List.test.ets +5 -0
- package/skills/a2h-arch-generate/scripts/module_create/hap/src/test/LocalUnit.test.ets +33 -0
- package/skills/a2h-arch-generate/scripts/module_create/har/Index.ets +1 -0
- package/skills/a2h-arch-generate/scripts/module_create/har/build-profile.json5 +36 -0
- package/skills/a2h-arch-generate/scripts/module_create/har/hvigorfile.ts +6 -0
- package/skills/a2h-arch-generate/scripts/module_create/har/obfuscation-rules.txt +23 -0
- package/skills/a2h-arch-generate/scripts/module_create/har/oh-package.json5 +9 -0
- package/skills/a2h-arch-generate/scripts/module_create/har/src/main/ets/components/MainPage.ets +19 -0
- package/skills/a2h-arch-generate/scripts/module_create/har/src/main/module.json5 +9 -0
- package/skills/a2h-arch-generate/scripts/module_create/har/src/main/resources/base/element/float.json +8 -0
- package/skills/a2h-arch-generate/scripts/module_create/har/src/main/resources/base/element/string.json +8 -0
- package/skills/a2h-arch-generate/scripts/module_create/har/src/ohosTest/ets/test/Ability.test.ets +35 -0
- package/skills/a2h-arch-generate/scripts/module_create/har/src/ohosTest/ets/test/List.test.ets +5 -0
- package/skills/a2h-arch-generate/scripts/module_create/har/src/ohosTest/module.json5 +11 -0
- package/skills/a2h-arch-generate/scripts/module_create/har/src/test/List.test.ets +5 -0
- package/skills/a2h-arch-generate/scripts/module_create/har/src/test/LocalUnit.test.ets +33 -0
- package/skills/a2h-arch-generate/scripts/module_create/hsp/Index.ets +1 -0
- package/skills/a2h-arch-generate/scripts/module_create/hsp/build-profile.json5 +36 -0
- package/skills/a2h-arch-generate/scripts/module_create/hsp/consumer-rules.txt +0 -0
- package/skills/a2h-arch-generate/scripts/module_create/hsp/hvigorfile.ts +6 -0
- package/skills/a2h-arch-generate/scripts/module_create/hsp/obfuscation-rules.txt +23 -0
- package/skills/a2h-arch-generate/scripts/module_create/hsp/oh-package.json5 +10 -0
- package/skills/a2h-arch-generate/scripts/module_create/hsp/src/main/ets/pages/Index.ets +20 -0
- package/skills/a2h-arch-generate/scripts/module_create/hsp/src/main/ets/utils/Calc.ets +3 -0
- package/skills/a2h-arch-generate/scripts/module_create/hsp/src/main/module.json5 +12 -0
- package/skills/a2h-arch-generate/scripts/module_create/hsp/src/main/resources/base/element/float.json +8 -0
- package/skills/a2h-arch-generate/scripts/module_create/hsp/src/main/resources/base/element/string.json +8 -0
- package/skills/a2h-arch-generate/scripts/module_create/hsp/src/main/resources/base/profile/main_pages.json +5 -0
- package/skills/a2h-arch-generate/scripts/module_create/hsp/src/ohosTest/ets/test/Ability.test.ets +35 -0
- package/skills/a2h-arch-generate/scripts/module_create/hsp/src/ohosTest/ets/test/List.test.ets +5 -0
- package/skills/a2h-arch-generate/scripts/module_create/hsp/src/ohosTest/module.json5 +11 -0
- package/skills/a2h-arch-generate/scripts/module_create/hsp/src/test/List.test.ets +5 -0
- package/skills/a2h-arch-generate/scripts/module_create/hsp/src/test/LocalUnit.test.ets +33 -0
- package/skills/a2h-arch-generate/scripts/module_create/testdata/reconcile-layer-PROJECT_DESIGN.md +47 -0
- package/skills/a2h-arch-generate/scripts/module_create/testdata/single-entry-PROJECT_DESIGN.md +15 -0
- package/skills/a2h-arch-generate/scripts/module_create/testdata/three-layer-PROJECT_DESIGN.md +36 -0
- package/skills/a2h-arch-generate/scripts/module_create/testdata/verification-report.md +150 -0
- package/skills/a2h-arch-generate/scripts/resolve_android_stores.mjs +529 -0
- package/skills/a2h-arch-generate/scripts/scaffold_project.mjs +230 -0
- 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 +1122 -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_router.mjs +138 -0
- package/skills/a2h-arch-generate/scripts/validate_architecture_docs.mjs +829 -0
- package/skills/a2h-arch-generate/scripts/validate_data_docs.mjs +937 -0
- package/skills/a2h-arch-generate/scripts/validate_homegraph_artifacts.mjs +542 -0
- package/skills/a2h-arch-generate/scripts/validate_incremental_docs.mjs +415 -0
- package/skills/a2h-arkts-logic-coder/SKILL.md +125 -0
- package/skills/a2h-arkts-logic-coder/references/ISSUES.md +6 -0
- package/skills/a2h-arkts-logic-coder/references/code-generation.md +124 -0
- package/skills/a2h-arkts-logic-coder/scripts/check_module_scope.ts +224 -0
- package/skills/a2h-arkts-logic-coder/scripts/check_mvvm.ts +377 -0
- package/skills/a2h-arkts-logic-coder/scripts/stop_check_hook.ts +443 -0
- package/skills/a2h-arkts-logic-coder/scripts/test_check_scripts.ts +211 -0
- package/skills/a2h-arkts-logic-coder/scripts/test_worktree_compat.ts +81 -0
- package/skills/a2h-batch-ui-align/SKILL.md +309 -0
- package/skills/a2h-batch-ui-align/assets/ColorUtils.ets +81 -0
- package/skills/a2h-batch-ui-align/flowchart.html +271 -0
- package/skills/{hmos-batch-ui-align → a2h-batch-ui-align}/references/conversion-procedure.md +523 -661
- package/skills/a2h-batch-ui-align/references/incremental-scope.md +139 -0
- package/skills/a2h-batch-ui-align/references/lottie-integration.md +43 -0
- package/skills/{hmos-batch-ui-align → a2h-batch-ui-align}/references/mappings/android-to-harmonyOS-ui-atomic-component-mapping-reference.md +8 -8
- package/skills/{hmos-batch-ui-align → a2h-batch-ui-align}/references/mappings/android-to-harmonyOS-ui-interaction-mapping-reference.md +3 -0
- package/skills/a2h-batch-ui-align/references/source-only-tier.md +32 -0
- package/skills/a2h-batch-ui-align/references/step3-capture.md +211 -0
- package/skills/a2h-batch-ui-align/references/step4-prepare.md +192 -0
- package/skills/a2h-batch-ui-align/references/step5-convert.md +202 -0
- package/skills/a2h-batch-ui-align/scripts/agent_cli.mjs +572 -0
- package/skills/{hmos-batch-ui-align → a2h-batch-ui-align}/scripts/android_parse_fast.ts +246 -39
- package/skills/a2h-batch-ui-align/scripts/answers_check.mjs +86 -0
- package/skills/a2h-batch-ui-align/scripts/arkts_static_check.ts +2689 -0
- package/skills/a2h-batch-ui-align/scripts/build_conversion_set.mjs +1656 -0
- package/skills/a2h-batch-ui-align/scripts/databinding_analyzer_design.md +79 -0
- package/skills/a2h-batch-ui-align/scripts/detach.mjs +258 -0
- package/skills/a2h-batch-ui-align/scripts/export_ui_info.mjs +1524 -0
- package/skills/a2h-batch-ui-align/scripts/generate_pages_json.mjs +612 -0
- package/skills/a2h-batch-ui-align/scripts/group_commit.mjs +166 -0
- package/skills/a2h-batch-ui-align/scripts/group_pack.mjs +1437 -0
- package/skills/a2h-batch-ui-align/scripts/group_queue.mjs +1869 -0
- package/skills/a2h-batch-ui-align/scripts/group_watch.mjs +696 -0
- package/skills/a2h-batch-ui-align/scripts/harmony_index.mjs +218 -0
- package/skills/a2h-batch-ui-align/scripts/host_env.mjs +208 -0
- package/skills/a2h-batch-ui-align/scripts/measure_pack.ts +1229 -0
- package/skills/a2h-batch-ui-align/scripts/occlusion.mjs +141 -0
- package/skills/a2h-batch-ui-align/scripts/phase5_check.mjs +1124 -0
- package/skills/a2h-batch-ui-align/scripts/shell_contract.mjs +996 -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_align_tint.test.mjs +253 -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_shell.test.mjs +72 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_weight_color.test.mjs +353 -0
- package/skills/a2h-batch-ui-align/scripts/tests/build_conversion_set.test.mjs +345 -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/export_ui_info.test.mjs +507 -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 +189 -0
- package/skills/a2h-batch-ui-align/scripts/tests/group_queue.test.mjs +1451 -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/measure_pack.test.mjs +170 -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 +244 -0
- package/skills/a2h-batch-ui-align/scripts/tests/shell_contract.test.mjs +130 -0
- package/skills/a2h-batch-ui-align/scripts/tests/test_bfs_exit.ts +49 -0
- package/skills/a2h-coldstart-smoke-gate/SKILL.md +57 -0
- package/skills/a2h-dashboard-render/SKILL.md +65 -0
- package/skills/a2h-dashboard-render/references/artifact-contract.jsonc +147 -0
- package/skills/a2h-dashboard-render/references/artifact-registry-spec.md +67 -0
- package/skills/a2h-dashboard-render/references/dashboard.config.example.json +19 -0
- package/skills/a2h-dashboard-render/references//347/234/213/346/235/277/350/257/264/346/230/216.md +83 -0
- package/skills/a2h-dashboard-render/scripts/artifact_contract.mjs +138 -0
- package/skills/a2h-dashboard-render/scripts/check-registry.mjs +87 -0
- package/skills/a2h-dashboard-render/scripts/dashboard.mjs +3215 -0
- package/skills/a2h-dashboard-render/scripts/device_capture.mjs +2010 -0
- package/skills/a2h-dashboard-render/scripts/page_capture.mjs +828 -0
- package/skills/a2h-dashboard-render/scripts/usage_readers.mjs +459 -0
- package/skills/a2h-dashboard-render/scripts/usage_worker.mjs +13 -0
- 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 +170 -0
- package/skills/a2h-dashboard-render/test/test_cli_check_registry.mjs +99 -0
- package/skills/a2h-dashboard-render/test/test_dashboard_architecture.mjs +182 -0
- package/skills/a2h-dashboard-render/test/test_dashboard_build.mjs +64 -0
- package/skills/a2h-dashboard-render/test/test_dashboard_node.mjs +1172 -0
- package/skills/a2h-dashboard-render/test/test_dashboard_spec_pipeline.mjs +251 -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 +303 -0
- package/skills/a2h-dashboard-render/test/test_page_capture.mjs +147 -0
- package/skills/a2h-dashboard-render/test/test_usage_readers.mjs +444 -0
- package/skills/{hmos-fix-build-errors → a2h-fix-build-errors}/SKILL.md +305 -293
- package/skills/a2h-module-semantic-docs/SKILL.md +227 -0
- package/skills/a2h-module-semantic-docs/scripts/commit_module_state.mjs +168 -0
- package/skills/a2h-module-semantic-docs/scripts/lib/py_compat.mjs +688 -0
- package/skills/a2h-module-semantic-docs/scripts/scan_modules.mjs +1021 -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-resource-convert/SKILL.md +369 -0
- package/skills/{hmos-resources-convert → a2h-resource-convert}/references/code-vector-icon-rules.md +4 -4
- package/skills/{hmos-resources-convert → a2h-resource-convert}/references/conversion-rules.md +16 -5
- package/skills/a2h-resource-convert/references/incremental-page-migration.md +251 -0
- package/skills/{hmos-resources-convert → a2h-resource-convert}/references/lottie-conversion-rules.md +17 -17
- package/skills/{hmos-resources-convert → a2h-resource-convert}/references/resource-mapping-rules.md +15 -4
- package/skills/a2h-resource-convert/references/step3_5-dependency-filter.md +54 -0
- package/skills/a2h-resource-convert/references/step4-qualifiers-and-values.md +142 -0
- package/skills/a2h-resource-convert/references/step4-resource-types.md +249 -0
- package/skills/a2h-resource-convert/references/step5-reference-resolution.md +154 -0
- package/skills/a2h-resource-convert/references/step7-report-template.md +217 -0
- package/skills/{hmos-resources-convert → a2h-resource-convert}/references/xml-drawable-to-svg-rules.md +38 -0
- package/skills/{hmos-resources-convert → a2h-resource-convert}/scripts/a2h_resource_convert.ts +456 -90
- package/skills/a2h-resource-convert/scripts/a2h_resource_incremental.ts +1072 -0
- package/skills/a2h-resource-convert/scripts/app_identity.ts +947 -0
- package/skills/{hmos-resources-convert → a2h-resource-convert}/scripts/code_vector_icons.ts +19 -3
- package/skills/a2h-resource-convert/scripts/extract_page_resources.ts +989 -0
- package/skills/a2h-resource-convert/scripts/extract_project_resources.ts +1464 -0
- 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-spec-design/SKILL.md +336 -0
- package/skills/a2h-spec-design/scripts/inspect_spec_design_inputs.mjs +146 -0
- package/skills/a2h-spec-design/scripts/lib/py_compat.mjs +481 -0
- package/skills/a2h-spec-design/scripts/move_spec_technical_reference.mjs +159 -0
- package/skills/a2h-spec-design/scripts/resolve_module_design.mjs +102 -0
- package/skills/a2h-spec-design/scripts/validate_spec_design_output.mjs +285 -0
- package/skills/a2h-spec-design/test/golden/inspect_happy.json +20 -0
- package/skills/a2h-spec-design/test/golden/move_design.md +18 -0
- package/skills/a2h-spec-design/test/golden/move_design_crlf.md +18 -0
- package/skills/a2h-spec-design/test/golden/move_spec.md +7 -0
- package/skills/a2h-spec-design/test/golden/resolve_cases.json +36 -0
- package/skills/a2h-spec-design/test/golden/validate_issue_file.md +12 -0
- package/skills/a2h-spec-design/test/golden/validate_issues.json +57 -0
- package/skills/a2h-spec-design/test/test_spec_design_scripts.mjs +381 -0
- package/skills/a2h-spec-design-pipeline/SKILL.md +228 -0
- package/skills/a2h-spec-design-pipeline/package.json +4 -0
- package/skills/a2h-spec-design-pipeline/references/coding-loop.md +63 -0
- package/skills/a2h-spec-design-pipeline/references/execution-model.md +69 -0
- package/skills/a2h-spec-design-pipeline/references/final-report-template.md +24 -0
- package/skills/a2h-spec-design-pipeline/references/initialization.md +57 -0
- package/skills/a2h-spec-design-pipeline/references/merge-queue.md +21 -0
- package/skills/a2h-spec-design-pipeline/references/scripts.md +27 -0
- package/skills/a2h-spec-design-pipeline/references/specs.example.json +19 -0
- package/skills/a2h-spec-design-pipeline/references/state-and-resume.md +21 -0
- package/skills/a2h-spec-design-pipeline/scripts/atomic_write.ts +42 -0
- package/skills/a2h-spec-design-pipeline/scripts/audit_claims.ts +252 -0
- package/skills/a2h-spec-design-pipeline/scripts/branch_landed.ts +77 -0
- package/skills/a2h-spec-design-pipeline/scripts/deps_ready.ts +195 -0
- package/skills/a2h-spec-design-pipeline/scripts/ensure_wt_index.ts +651 -0
- package/skills/a2h-spec-design-pipeline/scripts/git_baseline.ts +124 -0
- package/skills/a2h-spec-design-pipeline/scripts/inflight.mjs +944 -0
- package/skills/a2h-spec-design-pipeline/scripts/lib/bgcli.mjs +95 -0
- package/skills/a2h-spec-design-pipeline/scripts/plan_groups.ts +502 -0
- package/skills/a2h-spec-design-pipeline/scripts/plan_waves.ts +475 -0
- package/skills/a2h-spec-design-pipeline/scripts/reconcile.mjs +218 -0
- package/skills/a2h-spec-design-pipeline/scripts/resolve_wiring.ts +164 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_atomic_write.ts +44 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_audit_claims.ts +301 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_bgcli.mjs +64 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_branch_landed.ts +87 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_deps_ready.ts +265 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_ensure_wt_index.ts +675 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_git_baseline.ts +105 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_inflight.mjs +452 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_plan_groups.ts +375 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_plan_waves.ts +561 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_reconcile.mjs +182 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_resolve_wiring.ts +138 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_watchdog.mjs +289 -0
- package/skills/a2h-spec-design-pipeline/scripts/watchdog.mjs +441 -0
- package/skills/a2h-spec-generate/SKILL.md +285 -0
- package/skills/a2h-spec-generate/package.json +9 -0
- package/skills/a2h-spec-generate/references/batch-mode.md +151 -0
- package/skills/a2h-spec-generate/references/delete-blast-radius.md +3 -0
- package/skills/a2h-spec-generate/references/fusion-task-contract.md +114 -0
- package/skills/a2h-spec-generate/references/input-formats.md +27 -0
- package/skills/a2h-spec-generate/references/library-evidence.md +3 -0
- package/skills/a2h-spec-generate/references/method-discipline.md +64 -0
- package/skills/a2h-spec-generate/references/optional-gates.json +45 -0
- package/skills/a2h-spec-generate/references/recall-guide.md +83 -0
- package/skills/a2h-spec-generate/references/recall-terse.md +3 -0
- package/skills/a2h-spec-generate/references/recall-uniapp.md +10 -0
- package/skills/a2h-spec-generate/references/requirement-scope.md +122 -0
- package/skills/a2h-spec-generate/references/review-checklist.md +21 -0
- package/skills/a2h-spec-generate/references/spec-sample-complex.md +80 -0
- package/skills/a2h-spec-generate/references/spec-sample-transfer.md +43 -0
- package/skills/a2h-spec-generate/references/spec-samples.md +65 -0
- package/skills/a2h-spec-generate/references/specs.schema.json +79 -0
- package/skills/a2h-spec-generate/references/synthesis-rules.md +143 -0
- package/skills/a2h-spec-generate/references/transfer-file.md +5 -0
- package/skills/a2h-spec-generate/references/transfer-socket.md +5 -0
- package/skills/a2h-spec-generate/references/worker-rules.md +126 -0
- package/skills/a2h-spec-generate/scripts/check-fused-spec.mjs +514 -0
- package/skills/a2h-spec-generate/scripts/check_spec.ts +361 -0
- package/skills/a2h-spec-generate/scripts/collect-specs.mjs +470 -0
- package/skills/a2h-spec-generate/scripts/detect-project.mjs +271 -0
- package/skills/a2h-spec-generate/scripts/ensure-index.mjs +188 -0
- package/skills/a2h-spec-generate/scripts/feature-stem.mjs +150 -0
- package/skills/a2h-spec-generate/scripts/inspect-uniapp.mjs +733 -0
- package/skills/{hmos-spec-generate → a2h-spec-generate}/scripts/parse_requirements.ts +1 -1
- package/skills/a2h-spec-generate/scripts/prepare-facts.mjs +307 -0
- package/skills/a2h-spec-generate/scripts/publication-verdict.mjs +171 -0
- package/skills/a2h-spec-generate/scripts/publish-specs.mjs +280 -0
- package/skills/a2h-spec-generate/scripts/render-tasks.mjs +399 -0
- package/skills/a2h-spec-generate/scripts/report.mjs +132 -0
- package/skills/a2h-spec-generate/scripts/reqgen/assets/dashboard.html +149 -0
- package/skills/a2h-spec-generate/scripts/reqgen/assets/viz-api.js +49 -0
- package/skills/a2h-spec-generate/scripts/reqgen/assets/viz-code-view.js +140 -0
- package/skills/a2h-spec-generate/scripts/reqgen/assets/viz-format.js +16 -0
- package/skills/a2h-spec-generate/scripts/reqgen/assets/viz-handoff.js +42 -0
- package/skills/a2h-spec-generate/scripts/reqgen/assets/viz-splitters.js +78 -0
- package/skills/a2h-spec-generate/scripts/reqgen/assets/viz-state.js +47 -0
- package/skills/a2h-spec-generate/scripts/reqgen/assets/viz-tree.js +194 -0
- package/skills/a2h-spec-generate/scripts/reqgen/assets/viz-virtual-list.js +118 -0
- package/skills/a2h-spec-generate/scripts/reqgen/assets/viz.css +245 -0
- package/skills/a2h-spec-generate/scripts/reqgen/assets/viz.html +99 -0
- package/skills/a2h-spec-generate/scripts/reqgen/assets/viz.js +220 -0
- package/skills/a2h-spec-generate/scripts/reqgen/package-lock.json +47 -0
- package/skills/a2h-spec-generate/scripts/reqgen/package.json +23 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/agent-render/serve.ts +95 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/analysis/callback-call-sites.ts +82 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/analysis/graph/area-ownership.ts +496 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/analysis/graph/build.ts +2217 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/analysis/graph/callback-flow.ts +386 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/analysis/graph/component-variants.ts +845 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/analysis/graph/index.ts +24 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/analysis/names/index.ts +22 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/analysis/names/policy.ts +572 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/analysis/names/traceability.ts +580 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/analysis/req-model/build.ts +1270 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/analysis/req-model/index.ts +10 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/analysis/req-model/projection.ts +804 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/analysis/req-model/render-projection.ts +51 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/analysis/source-facts/android-interaction-registry.ts +286 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/analysis/source-facts/builder.ts +453 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/analysis/source-facts/compose-api-registry.ts +526 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/analysis/source-facts/index.ts +15 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/connector/index.ts +1 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/connector/utg-inbound.ts +763 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/contracts/area-graph.ts +383 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/contracts/artifact.ts +68 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/contracts/common.ts +88 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/contracts/diagnostic.ts +64 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/contracts/gap-audit.ts +113 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/contracts/index.ts +12 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/contracts/name-traceability.ts +108 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/contracts/raw-fact.ts +377 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/contracts/req-model.ts +238 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/contracts/run.ts +134 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/contracts/semantic-completeness.ts +35 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/contracts/source-facts.ts +48 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/contracts/utg.ts +133 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/core/output-guard.ts +42 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/core/stable-id.ts +118 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/cross-area-tally-cli.ts +179 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/dashboard-cli.ts +188 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/dump/dump.ts +1184 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/dump/index.ts +1 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/dump-cli.ts +373 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/fusion/area-facts.ts +1014 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/fusion/area-output.ts +32 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/fusion/schema.ts +142 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/fusion/selfcheck.ts +312 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/fusion/spec-bindings.ts +310 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/fusion/task-contract.ts +685 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/graph/paths.ts +575 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/homegraph-cli.ts +50 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/interaction-analysis/android-resource-resolver.ts +391 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/interaction-analysis/androidx-preference-contracts.ts +44 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/interaction-analysis/contracts.ts +640 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/interaction-analysis/cross-area.ts +207 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/interaction-analysis/finalizer.ts +1297 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/interaction-analysis/identity.ts +186 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/interaction-analysis/index.ts +16 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/interaction-analysis/planner.ts +312 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/interaction-analysis/preference-enrichment.ts +793 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/interaction-analysis/raw-facts.ts +355 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/interaction-analysis/rules.ts +271 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/interaction-analysis/scanner.ts +666 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/interaction-analysis/schema.ts +365 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/interaction-analysis/stable-key.ts +144 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/interaction-analysis/task-contract.ts +301 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/interaction-analysis/tree-sitter-adapter.ts +923 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/interaction-analysis/uniapp-utg-adapter.ts +543 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/interaction-analysis/xml-adapter.ts +262 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/model/assemble.ts +2079 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/model/contracts.ts +157 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/model/finalize.ts +809 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/model/index.ts +17 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/model/io.ts +165 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/model/prepare.ts +806 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/model/query.ts +360 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/model/seeds.ts +218 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/model/spec-bindings-sidecar.ts +240 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/model/task.ts +359 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/model-cli.ts +500 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/pipeline/index.ts +7 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/pipeline/output.ts +307 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/requirement-scope.ts +172 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/source-cov/index.ts +1 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/source-cov/source-cov.ts +176 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/source-index/homegraph.ts +1039 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/validation/area-graph.ts +490 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/validation/index.ts +23 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/validation/req-model.ts +957 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/validation/req-text.ts +248 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/validation/semantic-area-graph.ts +1600 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/validation/types.ts +10 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/viz/artifact-data.ts +201 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/viz/client/viz-api.ts +74 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/viz/client/viz-code-view.ts +180 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/viz/client/viz-format.ts +18 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/viz/client/viz-handoff.ts +55 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/viz/client/viz-splitters.ts +78 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/viz/client/viz-state.ts +66 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/viz/client/viz-tree.ts +232 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/viz/client/viz-virtual-list.ts +179 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/viz/client/viz.ts +240 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/viz/contracts.d.ts +86 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/viz/index.ts +3 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/viz/server.ts +239 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/viz/source-project.ts +316 -0
- package/skills/a2h-spec-generate/scripts/reqgen/src/viz-cli.ts +200 -0
- 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/fusion-area-facts.test.ts +576 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-contract.test.ts +290 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-finalize.test.ts +1323 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-prepare.test.ts +574 -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 +831 -0
- package/skills/a2h-spec-generate/scripts/reqgen/test/fusion-spec.test.ts +548 -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 +396 -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 +298 -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/tsconfig.json +16 -0
- package/skills/a2h-spec-generate/scripts/reqgen/tsconfig.viz-client.json +12 -0
- package/skills/a2h-spec-generate/test/check-fused-spec.test.mjs +632 -0
- package/skills/a2h-spec-generate/test/check-spec.test.ts +200 -0
- package/skills/a2h-spec-generate/test/collect-specs.test.mjs +538 -0
- package/skills/a2h-spec-generate/test/detect-project.test.mjs +37 -0
- package/skills/a2h-spec-generate/test/ensure-index.test.mjs +45 -0
- package/skills/a2h-spec-generate/test/feature-stem.test.mjs +147 -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/publication-verdict.test.mjs +157 -0
- package/skills/a2h-spec-generate/test/publish-specs.test.mjs +282 -0
- package/skills/a2h-spec-generate/test/render-tasks.test.mjs +593 -0
- package/skills/a2h-utg-explorer/SKILL.md +120 -0
- package/skills/a2h-utg-explorer/assets/final_viewer.html +64 -0
- package/skills/a2h-utg-explorer/assets/u2.LICENSE +21 -0
- package/skills/a2h-utg-explorer/assets/u2.NOTICE +25 -0
- package/skills/a2h-utg-explorer/assets/u2.jar +0 -0
- package/skills/a2h-utg-explorer/references/architecture.md +270 -0
- package/skills/a2h-utg-explorer/references/protocol.md +9 -0
- package/skills/a2h-utg-explorer/scripts/app_settings.mjs +143 -0
- package/skills/a2h-utg-explorer/scripts/audit.mjs +167 -0
- package/skills/a2h-utg-explorer/scripts/close_phases.mjs +66 -0
- package/skills/a2h-utg-explorer/scripts/compile_tasks.mjs +749 -0
- package/skills/a2h-utg-explorer/scripts/d_prereqs.mjs +597 -0
- package/skills/a2h-utg-explorer/scripts/device_health.mjs +227 -0
- package/skills/a2h-utg-explorer/scripts/direct_launch.mjs +276 -0
- package/skills/a2h-utg-explorer/scripts/evidence.mjs +108 -0
- package/skills/a2h-utg-explorer/scripts/final_utg.mjs +376 -0
- package/skills/a2h-utg-explorer/scripts/hint_check.mjs +89 -0
- package/skills/a2h-utg-explorer/scripts/plan.mjs +258 -0
- package/skills/a2h-utg-explorer/scripts/promote_dynamic.mjs +170 -0
- package/skills/a2h-utg-explorer/scripts/recover.mjs +467 -0
- package/skills/a2h-utg-explorer/scripts/recover_b.mjs +542 -0
- package/skills/a2h-utg-explorer/scripts/recover_d.mjs +302 -0
- package/skills/a2h-utg-explorer/scripts/rejudge.mjs +203 -0
- package/skills/a2h-utg-explorer/scripts/report.mjs +143 -0
- package/skills/a2h-utg-explorer/scripts/run_cycle.mjs +831 -0
- package/skills/a2h-utg-explorer/scripts/run_device.mjs +137 -0
- package/skills/a2h-utg-explorer/scripts/tests/attest.test.mjs +66 -0
- package/skills/a2h-utg-explorer/scripts/tests/chain.test.mjs +45 -0
- package/skills/a2h-utg-explorer/scripts/tests/compose_identity.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 +223 -0
- package/skills/a2h-utg-explorer/scripts/tests/device_health.test.mjs +88 -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 +136 -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/generalization_fixes.test.mjs +251 -0
- package/skills/a2h-utg-explorer/scripts/tests/hint_check.test.mjs +42 -0
- package/skills/a2h-utg-explorer/scripts/tests/interruptions.test.mjs +162 -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 +204 -0
- package/skills/a2h-utg-explorer/scripts/tests/page_identity_tiers.test.mjs +355 -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 +207 -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 +453 -0
- package/skills/a2h-utg-explorer/scripts/tests/runner_capabilities.test.mjs +131 -0
- package/skills/a2h-utg-explorer/scripts/tests/scope.test.mjs +229 -0
- package/skills/a2h-utg-explorer/scripts/tests/scroll_sweep.test.mjs +321 -0
- package/skills/a2h-utg-explorer/scripts/tests/semantics.test.mjs +102 -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/_device_io.mjs +244 -0
- package/skills/a2h-utg-explorer/scripts/utg_explorer/_py.mjs +2097 -0
- package/skills/a2h-utg-explorer/scripts/utg_explorer/adapters.mjs +1213 -0
- package/skills/a2h-utg-explorer/scripts/utg_explorer/attest.mjs +63 -0
- package/skills/a2h-utg-explorer/scripts/utg_explorer/chain.mjs +63 -0
- package/skills/a2h-utg-explorer/scripts/utg_explorer/coverage.mjs +89 -0
- package/skills/a2h-utg-explorer/scripts/utg_explorer/device_lock.mjs +46 -0
- package/skills/a2h-utg-explorer/scripts/utg_explorer/semantics.mjs +1136 -0
- package/skills/a2h-utg-explorer/scripts/utg_explorer/task_runner.mjs +1513 -0
- package/skills/a2h-utg-explorer/scripts/variant.mjs +75 -0
- package/skills/a2h-utg-explorer/scripts/worklist_parts.mjs +122 -0
- package/skills/a2h-utg-static/SKILL.md +361 -0
- package/skills/a2h-utg-static/config.json +19 -0
- package/skills/a2h-utg-static/references/extractors.md +217 -0
- package/skills/a2h-utg-static/references/ui-elements-static-utg-schema.md +248 -0
- package/skills/a2h-utg-static/references/view-interactions.md +215 -0
- package/skills/a2h-utg-static/scripts/_graph.mjs +361 -0
- package/skills/a2h-utg-static/scripts/_py.mjs +2177 -0
- package/skills/a2h-utg-static/scripts/_spawn.mjs +45 -0
- package/skills/a2h-utg-static/scripts/activity_nav.mjs +738 -0
- package/skills/a2h-utg-static/scripts/activity_widgets.mjs +254 -0
- package/skills/a2h-utg-static/scripts/adapter_nav.mjs +229 -0
- package/skills/a2h-utg-static/scripts/androidfragment_nav.mjs +208 -0
- package/skills/a2h-utg-static/scripts/assemble.mjs +2065 -0
- package/skills/a2h-utg-static/scripts/audit.mjs +268 -0
- package/skills/a2h-utg-static/scripts/carry_answers.mjs +201 -0
- package/skills/a2h-utg-static/scripts/click_paths.mjs +594 -0
- package/skills/a2h-utg-static/scripts/compose_body_text.mjs +172 -0
- package/skills/a2h-utg-static/scripts/compose_merge.mjs +263 -0
- package/skills/a2h-utg-static/scripts/compose_nav.mjs +1216 -0
- package/skills/a2h-utg-static/scripts/compose_navbar_nav.mjs +238 -0
- package/skills/a2h-utg-static/scripts/compose_overlay.mjs +2760 -0
- package/skills/a2h-utg-static/scripts/compose_titles.mjs +365 -0
- package/skills/a2h-utg-static/scripts/compose_widgets.mjs +498 -0
- package/skills/a2h-utg-static/scripts/dialog_listener_nav.mjs +237 -0
- package/skills/a2h-utg-static/scripts/dialogshow_nav.mjs +308 -0
- package/skills/a2h-utg-static/scripts/fragfactory_nav.mjs +170 -0
- package/skills/a2h-utg-static/scripts/fragment_nav.mjs +1136 -0
- package/skills/a2h-utg-static/scripts/guard_subjects.mjs +162 -0
- package/skills/a2h-utg-static/scripts/hg_query.mjs +137 -0
- package/skills/a2h-utg-static/scripts/host_resolve.mjs +393 -0
- package/skills/a2h-utg-static/scripts/hybrid_bundle.mjs +165 -0
- package/skills/a2h-utg-static/scripts/hybrid_pages.mjs +713 -0
- package/skills/a2h-utg-static/scripts/hybrid_scope.mjs +660 -0
- package/skills/a2h-utg-static/scripts/interaction_sites.mjs +267 -0
- package/skills/a2h-utg-static/scripts/io_utils.mjs +59 -0
- package/skills/a2h-utg-static/scripts/label_resolve.mjs +864 -0
- package/skills/a2h-utg-static/scripts/launch_extras.mjs +91 -0
- package/skills/a2h-utg-static/scripts/layout_resolve.mjs +148 -0
- package/skills/a2h-utg-static/scripts/manifest.mjs +483 -0
- package/skills/a2h-utg-static/scripts/measure/measure_corpus.mjs +297 -0
- package/skills/a2h-utg-static/scripts/measure/measure_guards.mjs +98 -0
- package/skills/a2h-utg-static/scripts/media_browse_nav.mjs +356 -0
- package/skills/a2h-utg-static/scripts/menu_nav.mjs +603 -0
- package/skills/a2h-utg-static/scripts/navactions_nav.mjs +255 -0
- package/skills/a2h-utg-static/scripts/nl_hints.mjs +453 -0
- package/skills/a2h-utg-static/scripts/orphan_overlay_nav.mjs +89 -0
- package/skills/a2h-utg-static/scripts/phase_plan.mjs +108 -0
- package/skills/a2h-utg-static/scripts/phase_planner.mjs +119 -0
- package/skills/a2h-utg-static/scripts/plaindialog_nav.mjs +411 -0
- package/skills/a2h-utg-static/scripts/preference_nav.mjs +761 -0
- package/skills/a2h-utg-static/scripts/preference_widgets.mjs +142 -0
- package/skills/a2h-utg-static/scripts/presenter_nav.mjs +490 -0
- package/skills/a2h-utg-static/scripts/registry_nav.mjs +288 -0
- package/skills/a2h-utg-static/scripts/run_pipeline.mjs +870 -0
- package/skills/a2h-utg-static/scripts/scope_utils.mjs +430 -0
- package/skills/a2h-utg-static/scripts/screen_merge.mjs +287 -0
- package/skills/a2h-utg-static/scripts/screen_nav.mjs +279 -0
- package/skills/a2h-utg-static/scripts/single_host_nav.mjs +291 -0
- package/skills/a2h-utg-static/scripts/starter_nav.mjs +198 -0
- package/skills/a2h-utg-static/scripts/state_guard.mjs +579 -0
- package/skills/a2h-utg-static/scripts/static_prior.mjs +904 -0
- package/skills/a2h-utg-static/scripts/tests/_zipw.mjs +28 -0
- package/skills/a2h-utg-static/scripts/tests/probe_autoload.mjs +108 -0
- package/skills/a2h-utg-static/scripts/tests/probe_layout_fragments.mjs +90 -0
- package/skills/a2h-utg-static/scripts/tests/probe_unknown_scope.mjs +61 -0
- package/skills/a2h-utg-static/scripts/tests/regression_matrix.mjs +1261 -0
- package/skills/a2h-utg-static/scripts/tests/test_activity_alias_launcher.mjs +90 -0
- package/skills/a2h-utg-static/scripts/tests/test_activity_supertype_chain.mjs +106 -0
- package/skills/a2h-utg-static/scripts/tests/test_bottom_sheet_container.mjs +58 -0
- package/skills/a2h-utg-static/scripts/tests/test_branch_guard.mjs +19 -0
- package/skills/a2h-utg-static/scripts/tests/test_callee_string_default.mjs +30 -0
- package/skills/a2h-utg-static/scripts/tests/test_carry_answers.mjs +103 -0
- package/skills/a2h-utg-static/scripts/tests/test_chrome_tokens.mjs +60 -0
- package/skills/a2h-utg-static/scripts/tests/test_commented_out_trigger.mjs +111 -0
- package/skills/a2h-utg-static/scripts/tests/test_commit_scope.mjs +113 -0
- package/skills/a2h-utg-static/scripts/tests/test_compose_file_private_route.mjs +117 -0
- package/skills/a2h-utg-static/scripts/tests/test_compose_nested_graph.mjs +166 -0
- package/skills/a2h-utg-static/scripts/tests/test_compose_route_holder_collision.mjs +112 -0
- package/skills/a2h-utg-static/scripts/tests/test_compose_vm_nav.mjs +267 -0
- package/skills/a2h-utg-static/scripts/tests/test_custom_source_root.mjs +71 -0
- package/skills/a2h-utg-static/scripts/tests/test_defensive_null_guard.mjs +77 -0
- package/skills/a2h-utg-static/scripts/tests/test_dialog_orphan_entries.mjs +99 -0
- package/skills/a2h-utg-static/scripts/tests/test_dialog_page_owner.mjs +69 -0
- package/skills/a2h-utg-static/scripts/tests/test_dialogshow_builder_forms.mjs +96 -0
- package/skills/a2h-utg-static/scripts/tests/test_dialogshow_java_factory.mjs +37 -0
- package/skills/a2h-utg-static/scripts/tests/test_disabled_guard.mjs +42 -0
- package/skills/a2h-utg-static/scripts/tests/test_drawer_panel_gesture.mjs +140 -0
- package/skills/a2h-utg-static/scripts/tests/test_edge_dedupe_by_gesture.mjs +111 -0
- package/skills/a2h-utg-static/scripts/tests/test_edge_provenance_lint.mjs +70 -0
- package/skills/a2h-utg-static/scripts/tests/test_enclosing_gesture.mjs +69 -0
- package/skills/a2h-utg-static/scripts/tests/test_external_surface_roots.mjs +43 -0
- package/skills/a2h-utg-static/scripts/tests/test_find_package_indirect.mjs +67 -0
- package/skills/a2h-utg-static/scripts/tests/test_forwarding_wrapper.mjs +38 -0
- package/skills/a2h-utg-static/scripts/tests/test_fragment_containment.mjs +85 -0
- package/skills/a2h-utg-static/scripts/tests/test_fragment_helper_trigger.mjs +92 -0
- package/skills/a2h-utg-static/scripts/tests/test_graph.mjs +55 -0
- package/skills/a2h-utg-static/scripts/tests/test_guard_clause.mjs +86 -0
- package/skills/a2h-utg-static/scripts/tests/test_hint_language.mjs +119 -0
- package/skills/a2h-utg-static/scripts/tests/test_host_kind_by_chain.mjs +68 -0
- package/skills/a2h-utg-static/scripts/tests/test_hybrid_bundle_attribution.mjs +74 -0
- package/skills/a2h-utg-static/scripts/tests/test_hybrid_bundled_pages.mjs +181 -0
- package/skills/a2h-utg-static/scripts/tests/test_hybrid_scope.mjs +293 -0
- package/skills/a2h-utg-static/scripts/tests/test_hybrid_title_renders.mjs +118 -0
- package/skills/a2h-utg-static/scripts/tests/test_interaction_sites.mjs +272 -0
- package/skills/a2h-utg-static/scripts/tests/test_item_data_instance.mjs +51 -0
- package/skills/a2h-utg-static/scripts/tests/test_kotlin_fn_spans.mjs +69 -0
- package/skills/a2h-utg-static/scripts/tests/test_label_accessor_forms.mjs +187 -0
- package/skills/a2h-utg-static/scripts/tests/test_label_source.mjs +70 -0
- package/skills/a2h-utg-static/scripts/tests/test_launch_intent_guard.mjs +67 -0
- package/skills/a2h-utg-static/scripts/tests/test_layout_declared_fragment.mjs +103 -0
- package/skills/a2h-utg-static/scripts/tests/test_listener_call_forms.mjs +79 -0
- package/skills/a2h-utg-static/scripts/tests/test_listener_receiver_binding.mjs +47 -0
- package/skills/a2h-utg-static/scripts/tests/test_manifest_exported_default.mjs +40 -0
- package/skills/a2h-utg-static/scripts/tests/test_manifest_filters_modules.mjs +84 -0
- package/skills/a2h-utg-static/scripts/tests/test_manifest_srcfile.mjs +68 -0
- package/skills/a2h-utg-static/scripts/tests/test_mode_and_cb_param.mjs +172 -0
- package/skills/a2h-utg-static/scripts/tests/test_module_namespace.mjs +33 -0
- package/skills/a2h-utg-static/scripts/tests/test_module_strings.mjs +44 -0
- package/skills/a2h-utg-static/scripts/tests/test_multiple_entry_contracts.mjs +80 -0
- package/skills/a2h-utg-static/scripts/tests/test_nav_graph_xml.mjs +35 -0
- package/skills/a2h-utg-static/scripts/tests/test_nl_hint_grammar.mjs +42 -0
- package/skills/a2h-utg-static/scripts/tests/test_nl_hints_gate.mjs +85 -0
- package/skills/a2h-utg-static/scripts/tests/test_node_id_collision.mjs +57 -0
- package/skills/a2h-utg-static/scripts/tests/test_non_gesture_step_flag.mjs +62 -0
- package/skills/a2h-utg-static/scripts/tests/test_out_of_scope_and_settings.mjs +72 -0
- package/skills/a2h-utg-static/scripts/tests/test_overload_and_climb.mjs +86 -0
- package/skills/a2h-utg-static/scripts/tests/test_pager_page_source.mjs +78 -0
- package/skills/a2h-utg-static/scripts/tests/test_pager_position_zero.mjs +65 -0
- package/skills/a2h-utg-static/scripts/tests/test_pager_variant_guard.mjs +172 -0
- package/skills/a2h-utg-static/scripts/tests/test_pipeline_llm_phases.mjs +107 -0
- package/skills/a2h-utg-static/scripts/tests/test_plain_dialog_nodes.mjs +167 -0
- package/skills/a2h-utg-static/scripts/tests/test_plaindialog_shared_anchor.mjs +117 -0
- package/skills/a2h-utg-static/scripts/tests/test_preference_click_nav.mjs +98 -0
- package/skills/a2h-utg-static/scripts/tests/test_preference_host_binding.mjs +87 -0
- package/skills/a2h-utg-static/scripts/tests/test_preference_nesting.mjs +183 -0
- package/skills/a2h-utg-static/scripts/tests/test_preference_widgets.mjs +48 -0
- package/skills/a2h-utg-static/scripts/tests/test_read_text_crlf.mjs +41 -0
- package/skills/a2h-utg-static/scripts/tests/test_resolver_tier_parity.mjs +126 -0
- package/skills/a2h-utg-static/scripts/tests/test_result_launcher.mjs +142 -0
- package/skills/a2h-utg-static/scripts/tests/test_review_fixes.mjs +135 -0
- package/skills/a2h-utg-static/scripts/tests/test_route_token_words.mjs +66 -0
- package/skills/a2h-utg-static/scripts/tests/test_same_name_decl_scope.mjs +236 -0
- package/skills/a2h-utg-static/scripts/tests/test_scope_utils.mjs +85 -0
- package/skills/a2h-utg-static/scripts/tests/test_sealed_dialog_state.mjs +148 -0
- package/skills/a2h-utg-static/scripts/tests/test_shared_overlay_split.mjs +63 -0
- package/skills/a2h-utg-static/scripts/tests/test_slug_parity.mjs +58 -0
- package/skills/a2h-utg-static/scripts/tests/test_starter_node_id.mjs +41 -0
- package/skills/a2h-utg-static/scripts/tests/test_state_guard_arity.mjs +109 -0
- package/skills/a2h-utg-static/scripts/tests/test_state_guard_commented_candidates.mjs +68 -0
- package/skills/a2h-utg-static/scripts/tests/test_state_guard_model_gates.mjs +127 -0
- package/skills/a2h-utg-static/scripts/tests/test_state_specific_hop.mjs +130 -0
- package/skills/a2h-utg-static/scripts/tests/test_synthetic_label_identity.mjs +51 -0
- package/skills/a2h-utg-static/scripts/tests/test_template_method_layout.mjs +81 -0
- package/skills/a2h-utg-static/scripts/tests/test_template_title.mjs +58 -0
- package/skills/a2h-utg-static/scripts/tests/test_trigger_id_spelling.mjs +68 -0
- package/skills/a2h-utg-static/scripts/tests/test_ui_elements_action_override.mjs +91 -0
- package/skills/a2h-utg-static/scripts/tests/test_ui_elements_flow_filter.mjs +110 -0
- package/skills/a2h-utg-static/scripts/tests/test_ui_elements_nl_hint_key.mjs +89 -0
- package/skills/a2h-utg-static/scripts/tests/test_uiless_host_fold.mjs +98 -0
- package/skills/a2h-utg-static/scripts/tests/test_uniapp_source.mjs +231 -0
- package/skills/a2h-utg-static/scripts/tests/test_view_click_refs.mjs +104 -0
- package/skills/a2h-utg-static/scripts/tests/test_view_id_label.mjs +69 -0
- package/skills/a2h-utg-static/scripts/tests/test_view_interactions.mjs +346 -0
- package/skills/a2h-utg-static/scripts/tests/test_viewpage_nav.mjs +273 -0
- package/skills/a2h-utg-static/scripts/tests/test_vm_nav_helper_navigate.mjs +98 -0
- package/skills/a2h-utg-static/scripts/tests/test_widget_class_scope.mjs +92 -0
- package/skills/a2h-utg-static/scripts/tests/test_window_nav_kotlin.mjs +158 -0
- package/skills/a2h-utg-static/scripts/tests/test_worklist_parts.mjs +65 -0
- package/skills/a2h-utg-static/scripts/uniapp_nav.mjs +1119 -0
- package/skills/a2h-utg-static/scripts/uniapp_widgets.mjs +244 -0
- package/skills/a2h-utg-static/scripts/utg_html.mjs +721 -0
- package/skills/a2h-utg-static/scripts/view_interactions.mjs +799 -0
- package/skills/a2h-utg-static/scripts/view_widgets.mjs +512 -0
- package/skills/a2h-utg-static/scripts/viewpage_nav.mjs +485 -0
- package/skills/a2h-utg-static/scripts/vm_nav.mjs +422 -0
- package/skills/a2h-utg-static/scripts/window_nav.mjs +240 -0
- package/skills/a2h-utg-static/scripts/worklist_parts.mjs +154 -0
- package/skills/a2h-utg-static/tools/convert_static_utg_to_ui_elements.ts +769 -0
- package/skills/a2h-utg-static/tools/package.json +3 -0
- package/README.md +0 -427
- package/agents/logic-coder.md +0 -224
- package/agents/logic-context-builder.md +0 -212
- package/agents/scripts/hmos-precheck/backends/arkts.mjs +0 -567
- package/agents/scripts/hmos-precheck/backends/arkts_diff.mjs +0 -159
- package/agents/scripts/hmos-precheck/backends/arkts_project_rules.mjs +0 -398
- package/agents/scripts/hmos-precheck/backends/codelinter.mjs +0 -250
- package/agents/scripts/hmos-precheck/backends/project_integrity.mjs +0 -321
- package/agents/scripts/hmos-precheck/backends/static_precheck.mjs +0 -247
- package/agents/scripts/hmos-precheck/core/config.mjs +0 -184
- package/agents/scripts/hmos-precheck/core/diagnostic_scope.mjs +0 -20
- package/agents/scripts/hmos-precheck/core/process_adapter.mjs +0 -47
- package/agents/scripts/hmos-precheck/core/project_catalog.mjs +0 -50
- package/agents/scripts/hmos-precheck/core/result_projection.mjs +0 -147
- package/agents/scripts/hmos-precheck/core/scope_plan.mjs +0 -131
- package/agents/scripts/hmos-precheck/core/sdk_context.mjs +0 -67
- package/agents/scripts/hmos-precheck/docs/architecture.md +0 -37
- package/agents/scripts/hmos-precheck/docs/performance-optimization.md +0 -28
- package/agents/scripts/hmos-precheck/docs/upstream-reference.json +0 -19
- package/agents/scripts/hmos-precheck/docs/validation.md +0 -50
- package/agents/scripts/hmos-precheck/index.mjs +0 -17
- package/agents/scripts/hmos-precheck/invocation.mjs +0 -231
- package/agents/scripts/hmos-precheck/rules/rule_case_matrix.csv +0 -32
- package/agents/scripts/hmos-precheck/rules/rule_inventory.csv +0 -64
- package/agents/scripts/hmos-precheck/rules/rule_inventory.mjs +0 -59
- package/agents/scripts/hmos-precheck/rules/rule_policy.mjs +0 -54
- package/agents/scripts/platform_query.mjs +0 -626
- package/agents/scripts/platform_query.test.mjs +0 -422
- package/agents/self-test-fixer.md +0 -298
- package/agents/self-tester.md +0 -376
- package/agents/test-case-generation-generator.md +0 -317
- package/agents/test-case-generation-validator.md +0 -231
- package/dist/cli/config-store.js +0 -390
- package/dist/cli/config.js +0 -46
- package/dist/cli/env-vars.js +0 -127
- package/dist/cli/index.js +0 -56
- package/dist/cli/init.js +0 -1194
- package/dist/cli/uninstall.js +0 -427
- package/dist/utils/regex.js +0 -8
- package/env-requirements.json +0 -178
- package/resource/choose_editor.png +0 -0
- package/resource/convert_pipeline_process.svg +0 -103
- package/resource/project_architecture.svg +0 -122
- package/resource/set_environment.png +0 -0
- package/resource/set_multimodel.png +0 -0
- package/resource/set_sdk.png +0 -0
- package/resource/title_dark.png +0 -0
- package/skills/hmos-batch-ui-align/SKILL.md +0 -413
- package/skills/hmos-batch-ui-align/scripts/arkts_static_check.ts +0 -1592
- package/skills/hmos-batch-ui-align/scripts/measure_pack.ts +0 -752
- package/skills/hmos-convert-pipeline/SKILL.md +0 -476
- package/skills/hmos-incremental-ui-align/README.md +0 -251
- package/skills/hmos-incremental-ui-align/SKILL.md +0 -375
- package/skills/hmos-incremental-ui-align/diff_analysis.md +0 -53
- package/skills/hmos-incremental-ui-align/page_align.md +0 -62
- package/skills/hmos-incremental-ui-align/references/Comparison_Template.md +0 -38
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/@Link/350/243/205/351/245/260/345/231/250/357/274/232/347/210/266/345/255/220/345/217/214/345/220/221/345/220/214/346/255/245.md +0 -648
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/@Observed/350/243/205/351/245/260/345/231/250/345/222/214@ObjectLink/350/243/205/351/245/260/345/231/250/357/274/232/345/265/214/345/245/227/347/261/273/345/257/271/350/261/241/345/261/236/346/200/247/345/217/230/345/214/226.md +0 -2089
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/@Prop/350/243/205/351/245/260/345/231/250/357/274/232/347/210/266/345/255/220/345/215/225/345/220/221/345/220/214/346/255/245.md +0 -1033
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/@Provide/350/243/205/351/245/260/345/231/250/345/222/214@Consume/350/243/205/351/245/260/345/231/250/357/274/232/344/270/216/345/220/216/344/273/243/347/273/204/344/273/266/345/217/214/345/220/221/345/220/214/346/255/245.md +0 -1183
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/@State/350/243/205/351/245/260/345/231/250/357/274/232/347/273/204/344/273/266/345/206/205/347/212/266/346/200/201.md +0 -576
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/@Track/350/243/205/351/245/260/345/231/250/357/274/232class/345/257/271/350/261/241/345/261/236/346/200/247/347/272/247/346/233/264/346/226/260.md +0 -297
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/@Watch/350/243/205/351/245/260/345/231/250/357/274/232/347/212/266/346/200/201/345/217/230/351/207/217/346/233/264/346/224/271/351/200/232/347/237/245.md +0 -395
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/AppStorage/357/274/232/345/272/224/347/224/250/345/205/250/345/261/200/347/232/204UI/347/212/266/346/200/201/345/255/230/345/202/250.md +0 -903
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/Environment/357/274/232/350/256/276/345/244/207/347/216/257/345/242/203/346/237/245/350/257/242.md +0 -106
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/LocalStorage/357/274/232/351/241/265/351/235/242/347/272/247UI/347/212/266/346/200/201/345/255/230/345/202/250.md +0 -1178
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/MVVM/346/250/241/345/274/217V1.md +0 -911
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/PersistentStorage/357/274/232/346/214/201/344/271/205/345/214/226/345/255/230/345/202/250UI/347/212/266/346/200/201.md +0 -355
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243//347/256/241/347/220/206/345/272/224/347/224/250/346/213/245/346/234/211/347/232/204/347/212/266/346/200/201/346/246/202/350/277/260.md +0 -11
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/!!/350/257/255/346/263/225/357/274/232/345/217/214/345/220/221/347/273/221/345/256/232.md +0 -206
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/@Computed/350/243/205/351/245/260/345/231/250/357/274/232/350/256/241/347/256/227/345/261/236/346/200/247.md +0 -373
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/@Event/350/243/205/351/245/260/345/231/250/357/274/232/350/247/204/350/214/203/347/273/204/344/273/266/350/276/223/345/207/272.md +0 -158
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/@Local/350/243/205/351/245/260/345/231/250/357/274/232/347/273/204/344/273/266/345/206/205/351/203/250/347/212/266/346/200/201.md +0 -750
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/@Monitor/350/243/205/351/245/260/345/231/250/357/274/232/347/212/266/346/200/201/345/217/230/351/207/217/344/277/256/346/224/271/345/274/202/346/255/245/347/233/221/345/220/254.md +0 -1704
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/@ObservedV2/350/243/205/351/245/260/345/231/250/345/222/214@Trace/350/243/205/351/245/260/345/231/250/357/274/232/347/261/273/345/261/236/346/200/247/345/217/230/345/214/226/350/247/202/346/265/213.md +0 -1012
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/@Once/350/243/205/351/245/260/345/231/250/357/274/232/345/210/235/345/247/213/345/214/226/345/220/214/346/255/245/344/270/200/346/254/241.md +0 -164
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/@Param/350/243/205/351/245/260/345/231/250/357/274/232/347/273/204/344/273/266/345/244/226/351/203/250/350/276/223/345/205/245.md +0 -840
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/@Provider/350/243/205/351/245/260/345/231/250/345/222/214@Consumer/350/243/205/351/245/260/345/231/250/357/274/232/350/267/250/347/273/204/344/273/266/345/261/202/347/272/247/345/217/214/345/220/221/345/220/214/346/255/245.md +0 -856
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/@Type/350/243/205/351/245/260/345/231/250/357/274/232/346/240/207/350/256/260/347/261/273/345/261/236/346/200/247/347/232/204/347/261/273/345/236/213.md +0 -83
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/AppStorageV2/357/274/232/345/272/224/347/224/250/345/205/250/345/261/200UI/347/212/266/346/200/201/345/255/230/345/202/250.md +0 -294
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/PersistenceV2/357/274/232/346/214/201/344/271/205/345/214/226/345/255/230/345/202/250UI/347/212/266/346/200/201.md +0 -1220
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/_/350/214/203/345/274/217/351/200/211/346/213/251/350/257/264/346/230/216.md +0 -47
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2//347/212/266/346/200/201/347/256/241/347/220/206V1/345/220/221V2/350/277/201/347/247/273/344/270/216/346/267/267/347/224/250/346/214/207/345/257/274.md +0 -840
- package/skills/hmos-incremental-ui-align/references/State_Model_Template.md +0 -74
- package/skills/hmos-incremental-ui-align/references/UI_Analysis_Template.md +0 -34
- package/skills/hmos-incremental-ui-align/references/android-to-harmonyOS-ui-atomic-component-mapping-reference.md +0 -2533
- package/skills/hmos-incremental-ui-align/references/android-to-harmonyOS-ui-interaction-mapping-reference.md +0 -555
- package/skills/hmos-incremental-ui-align/references/android-to-harmonyOS-ui-layout-mapping-reference.md +0 -117
- package/skills/hmos-incremental-ui-align/scripts/app_feature_verify.ts +0 -937
- package/skills/hmos-incremental-ui-align/scripts/extract_checklist.ts +0 -343
- package/skills/hmos-incremental-ui-align/scripts/navigation-capure.md +0 -76
- package/skills/hmos-incremental-ui-align/scripts/page_capture.ts +0 -977
- package/skills/hmos-incremental-ui-align/scripts/page_capture_burst.ts +0 -188
- package/skills/hmos-integration-test/README.md +0 -300
- package/skills/hmos-integration-test/SKILL.md +0 -397
- package/skills/hmos-resources-convert/SKILL.md +0 -891
- package/skills/hmos-spec-generate/SKILL.md +0 -404
- package/skills/hmos-test-case-generation/README.md +0 -241
- package/skills/hmos-test-case-generation/SKILL.md +0 -324
- package/skills/hmos-test-case-generation/references/contract.md +0 -315
- package/skills/hmos-test-case-generation/references/review-notes-template.md +0 -84
- package/skills/hmos-test-case-generation/references/ui-elements-schema.md +0 -142
- package/skills/hmos-test-case-generation/tools/convert_to_ui_elements.ts +0 -550
- package/skills/hmos-test-case-generation/tools/validate.ts +0 -1312
- package/tools/bfs-crawl/README.md +0 -73
- package/tools/bfs-crawl/android_viewtree_bfs_crawler.ts +0 -1662
- package/tools/test-tools/autotest/config.ts +0 -175
- package/tools/test-tools/autotest/deps/autotest-agent-0.1.1.tgz +0 -0
- package/tools/test-tools/autotest/docs/README.md +0 -266
- package/tools/test-tools/autotest/docs/testcases_schema.md +0 -143
- package/tools/test-tools/autotest/engine/batch-launcher.ts +0 -327
- package/tools/test-tools/autotest/engine/report-tool.ts +0 -773
- package/tools/test-tools/autotest/engine/self-test-runner.ts +0 -961
- package/tools/test-tools/autotest/engine/testcases-tool.ts +0 -246
- package/tools/test-tools/autotest/paths.ts +0 -41
- package/tools/test-tools/autotest/resolve-metadata-tool.ts +0 -143
- package/tools/test-tools/autotest/runner/logger.ts +0 -45
- package/tools/test-tools/autotest/runner/process-utils.ts +0 -41
- package/tools/test-tools/autotest/validate.ts +0 -167
- /package/skills/{hmos-batch-ui-align/references/mvvm-v2/MVVM/346/250/241/345/274/217/357/274/210V2/357/274/211.md" → a2h-arch-generate/references/arkts-mvvm-v2.md} +0 -0
- /package/{README.en.md → skills/a2h-arch-generate/scripts/module_create/har/consumer-rules.txt} +0 -0
- /package/skills/{hmos-batch-ui-align → a2h-batch-ui-align}/references/mappings/android-to-harmonyOS-ui-layout-mapping-reference.md +0 -0
- /package/skills/{hmos-batch-ui-align → a2h-batch-ui-align}/references/mvvm/@Link/350/243/205/351/245/260/345/231/250/357/274/232/347/210/266/345/255/220/345/217/214/345/220/221/345/220/214/346/255/245.md" +0 -0
- /package/skills/{hmos-batch-ui-align → a2h-batch-ui-align}/references/mvvm/@Observed/350/243/205/351/245/260/345/231/250/345/222/214@ObjectLink/350/243/205/351/245/260/345/231/250/357/274/232/345/265/214/345/245/227/347/261/273/345/257/271/350/261/241/345/261/236/346/200/247/345/217/230/345/214/226.md" +0 -0
- /package/skills/{hmos-batch-ui-align → a2h-batch-ui-align}/references/mvvm/@Prop/350/243/205/351/245/260/345/231/250/357/274/232/347/210/266/345/255/220/345/215/225/345/220/221/345/220/214/346/255/245.md" +0 -0
- /package/skills/{hmos-batch-ui-align → a2h-batch-ui-align}/references/mvvm/@Provide/350/243/205/351/245/260/345/231/250/345/222/214@Consume/350/243/205/351/245/260/345/231/250/357/274/232/344/270/216/345/220/216/344/273/243/347/273/204/344/273/266/345/217/214/345/220/221/345/220/214/346/255/245.md" +0 -0
- /package/skills/{hmos-batch-ui-align → a2h-batch-ui-align}/references/mvvm/@State/350/243/205/351/245/260/345/231/250/357/274/232/347/273/204/344/273/266/345/206/205/347/212/266/346/200/201.md" +0 -0
- /package/skills/{hmos-batch-ui-align → a2h-batch-ui-align}/references/mvvm/@Track/350/243/205/351/245/260/345/231/250/357/274/232class/345/257/271/350/261/241/345/261/236/346/200/247/347/272/247/346/233/264/346/226/260.md" +0 -0
- /package/skills/{hmos-batch-ui-align → a2h-batch-ui-align}/references/mvvm/@Watch/350/243/205/351/245/260/345/231/250/357/274/232/347/212/266/346/200/201/345/217/230/351/207/217/346/233/264/346/224/271/351/200/232/347/237/245.md" +0 -0
- /package/skills/{hmos-batch-ui-align → a2h-batch-ui-align}/references/mvvm/AppStorage/357/274/232/345/272/224/347/224/250/345/205/250/345/261/200/347/232/204UI/347/212/266/346/200/201/345/255/230/345/202/250.md" +0 -0
- /package/skills/{hmos-batch-ui-align → a2h-batch-ui-align}/references/mvvm/Environment/357/274/232/350/256/276/345/244/207/347/216/257/345/242/203/346/237/245/350/257/242.md" +0 -0
- /package/skills/{hmos-batch-ui-align → a2h-batch-ui-align}/references/mvvm/LocalStorage/357/274/232/351/241/265/351/235/242/347/272/247UI/347/212/266/346/200/201/345/255/230/345/202/250.md" +0 -0
- /package/skills/{hmos-batch-ui-align → a2h-batch-ui-align}/references/mvvm/MVVM/346/250/241/345/274/217/357/274/210V1/357/274/211.md" +0 -0
- /package/skills/{hmos-batch-ui-align → a2h-batch-ui-align}/references/mvvm/PersistentStorage/357/274/232/346/214/201/344/271/205/345/214/226/345/255/230/345/202/250UI/347/212/266/346/200/201.md" +0 -0
- /package/skills/{hmos-batch-ui-align → a2h-batch-ui-align}/references/mvvm//347/256/241/347/220/206/345/272/224/347/224/250/346/213/245/346/234/211/347/232/204/347/212/266/346/200/201/346/246/202/350/277/260.md" +0 -0
- /package/skills/{hmos-batch-ui-align → a2h-batch-ui-align}/references/mvvm-v2/!!/350/257/255/346/263/225/357/274/232/345/217/214/345/220/221/347/273/221/345/256/232.md" +0 -0
- /package/skills/{hmos-batch-ui-align → a2h-batch-ui-align}/references/mvvm-v2/@Computed/350/243/205/351/245/260/345/231/250/357/274/232/350/256/241/347/256/227/345/261/236/346/200/247.md" +0 -0
- /package/skills/{hmos-batch-ui-align → a2h-batch-ui-align}/references/mvvm-v2/@Event/350/243/205/351/245/260/345/231/250/357/274/232/350/247/204/350/214/203/347/273/204/344/273/266/350/276/223/345/207/272.md" +0 -0
- /package/skills/{hmos-batch-ui-align → a2h-batch-ui-align}/references/mvvm-v2/@Local/350/243/205/351/245/260/345/231/250/357/274/232/347/273/204/344/273/266/345/206/205/351/203/250/347/212/266/346/200/201.md" +0 -0
- /package/skills/{hmos-batch-ui-align → a2h-batch-ui-align}/references/mvvm-v2/@Monitor/350/243/205/351/245/260/345/231/250/357/274/232/347/212/266/346/200/201/345/217/230/351/207/217/344/277/256/346/224/271/345/274/202/346/255/245/347/233/221/345/220/254.md" +0 -0
- /package/skills/{hmos-batch-ui-align → a2h-batch-ui-align}/references/mvvm-v2/@ObservedV2/350/243/205/351/245/260/345/231/250/345/222/214@Trace/350/243/205/351/245/260/345/231/250/357/274/232/347/261/273/345/261/236/346/200/247/345/217/230/345/214/226/350/247/202/346/265/213.md" +0 -0
- /package/skills/{hmos-batch-ui-align → a2h-batch-ui-align}/references/mvvm-v2/@Once/350/243/205/351/245/260/345/231/250/357/274/232/345/210/235/345/247/213/345/214/226/345/220/214/346/255/245/344/270/200/346/254/241.md" +0 -0
- /package/skills/{hmos-batch-ui-align → a2h-batch-ui-align}/references/mvvm-v2/@Param/350/243/205/351/245/260/345/231/250/357/274/232/347/273/204/344/273/266/345/244/226/351/203/250/350/276/223/345/205/245.md" +0 -0
- /package/skills/{hmos-batch-ui-align → a2h-batch-ui-align}/references/mvvm-v2/@Provider/350/243/205/351/245/260/345/231/250/345/222/214@Consumer/350/243/205/351/245/260/345/231/250/357/274/232/350/267/250/347/273/204/344/273/266/345/261/202/347/272/247/345/217/214/345/220/221/345/220/214/346/255/245.md" +0 -0
- /package/skills/{hmos-batch-ui-align → a2h-batch-ui-align}/references/mvvm-v2/@Type/350/243/205/351/245/260/345/231/250/357/274/232/346/240/207/350/256/260/347/261/273/345/261/236/346/200/247/347/232/204/347/261/273/345/236/213.md" +0 -0
- /package/skills/{hmos-batch-ui-align → a2h-batch-ui-align}/references/mvvm-v2/AppStorageV2/357/274/232/345/272/224/347/224/250/345/205/250/345/261/200UI/347/212/266/346/200/201/345/255/230/345/202/250.md" +0 -0
- /package/skills/{hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2 → a2h-batch-ui-align/references/mvvm-v2}/MVVM/346/250/241/345/274/217/357/274/210V2/357/274/211.md" +0 -0
- /package/skills/{hmos-batch-ui-align → a2h-batch-ui-align}/references/mvvm-v2/PersistenceV2/357/274/232/346/214/201/344/271/205/345/214/226/345/255/230/345/202/250UI/347/212/266/346/200/201.md" +0 -0
- /package/skills/{hmos-batch-ui-align → a2h-batch-ui-align}/references/mvvm-v2/_/350/214/203/345/274/217/351/200/211/346/213/251/350/257/264/346/230/216.md" +0 -0
- /package/skills/{hmos-batch-ui-align → a2h-batch-ui-align}/references/mvvm-v2/_/350/243/205/351/245/260/345/231/250/351/200/237/346/237/245.md" +0 -0
- /package/skills/{hmos-batch-ui-align → a2h-batch-ui-align}/references/mvvm-v2//347/212/266/346/200/201/347/256/241/347/220/206V1/345/220/221V2/350/277/201/347/247/273/344/270/216/346/267/267/347/224/250/346/214/207/345/257/274.md" +0 -0
- /package/skills/{hmos-fix-build-errors → a2h-fix-build-errors}/references/arkts-strict-patterns.md +0 -0
- /package/skills/{hmos-fix-build-errors → a2h-fix-build-errors}/references/known-patterns.md +0 -0
- /package/skills/{hmos-fix-build-errors → a2h-fix-build-errors}/references/rdb-entity-pattern.md +0 -0
- /package/skills/{hmos-resources-convert → a2h-resource-convert}/references/dependency-analysis-rules.md +0 -0
- /package/skills/{hmos-resources-convert → a2h-resource-convert}/scripts/svg_fidelity_check.ts +0 -0
- /package/skills/{hmos-spec-generate → a2h-spec-generate}/template/REQ.txt +0 -0
- /package/skills/{hmos-spec-generate → a2h-spec-generate}/template/REQ.xlsx +0 -0
|
@@ -0,0 +1,1184 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Human-readable recursive tree dumps of the AreaGraph / ReqModel IR, in the
|
|
3
|
+
* style of finer's NfaEntry.stringifyNfa(): `<id> {kind} -> children`,
|
|
4
|
+
* indented per depth, with cross-references rendered as `<id>` instead of
|
|
5
|
+
* being re-expanded (Area/ReqArea containment is a tree; only Edge/target
|
|
6
|
+
* refs cross back into sibling entries, so those never recurse).
|
|
7
|
+
*
|
|
8
|
+
* Entity type is carried entirely by symbols, not English words, so it is
|
|
9
|
+
* stated once instead of twice per line (see DEVELOPER.md for the canonical
|
|
10
|
+
* legend; kept in sync here):
|
|
11
|
+
* <tag:id> identity / cross-reference (tag = entity kind: area, control,
|
|
12
|
+
* action, effect, entry, external, req-area, feature,
|
|
13
|
+
* interaction, unresolved, text, path, ...)
|
|
14
|
+
* Symbol source code symbol: prefer className = functionName > other
|
|
15
|
+
* source code symbols. Short name, not qualified name — present
|
|
16
|
+
* only when a source-facts.json was supplied to the dump.
|
|
17
|
+
* {kind} the entity's own sub-kind/trigger/tag detail
|
|
18
|
+
* "text" a display name or free-text value
|
|
19
|
+
* -> leads to / targets (edges, entry roots, interaction targets)
|
|
20
|
+
* -[label]-> one canonical-path hop
|
|
21
|
+
* @Anchor source code anchor: basename:line range (degrading to a single
|
|
22
|
+
* line number when start==end), or the full path relative to
|
|
23
|
+
* the project root when the basename collides with another
|
|
24
|
+
* distinct full path within the same dump (collidingBasenames)
|
|
25
|
+
* ?<id> unresolved reference
|
|
26
|
+
* Real ids are `tag:caseId/subkind/hash`; caseId and subkind duplicate
|
|
27
|
+
* information already shown elsewhere (the case is named once at the top,
|
|
28
|
+
* subkind is the {kind} brace), so only the tag and a 6-char hash prefix are
|
|
29
|
+
* kept — `shortId` leaves short, single-segment ids (as used in this file's
|
|
30
|
+
* own tests) unchanged.
|
|
31
|
+
*
|
|
32
|
+
* Common shapes:
|
|
33
|
+
* <tag:Id> Symbol {kind} "text" @Anchor ->
|
|
34
|
+
* <tag:Id> Symbol {kind} "text" @Anchor - [label] ->
|
|
35
|
+
*
|
|
36
|
+
* This module depends only on `contracts/*` (artifact types) — it renders
|
|
37
|
+
* precomputed JSON, the same intermediate results Render itself consumes,
|
|
38
|
+
* and never invokes Model/Render analysis code to (re)compute anything.
|
|
39
|
+
* Where a precomputed artifact already encodes a better answer than can be derived
|
|
40
|
+
* from source-facts.json alone (name-traceability.json's ranked identity
|
|
41
|
+
* decision vs. a first-match heuristic), dump prefers that precomputed
|
|
42
|
+
* answer over deriving its own.
|
|
43
|
+
*/
|
|
44
|
+
import type {
|
|
45
|
+
Action,
|
|
46
|
+
Area,
|
|
47
|
+
Control,
|
|
48
|
+
ConditionAlternative,
|
|
49
|
+
Edge,
|
|
50
|
+
Effect,
|
|
51
|
+
EntryPoint,
|
|
52
|
+
ExternalEndpoint,
|
|
53
|
+
AreaGraphView
|
|
54
|
+
} from "../contracts/area-graph.ts";
|
|
55
|
+
import type { SupportedValue, UnresolvedItem } from "../contracts/artifact.ts";
|
|
56
|
+
import type { JsonValue, SourceLocation } from "../contracts/common.ts";
|
|
57
|
+
import type { Diagnostic } from "../contracts/diagnostic.ts";
|
|
58
|
+
import type {
|
|
59
|
+
GapAuditArtifact,
|
|
60
|
+
GapAuditCandidate,
|
|
61
|
+
GapAuditCategory,
|
|
62
|
+
GapAuditSummary
|
|
63
|
+
} from "../contracts/gap-audit.ts";
|
|
64
|
+
import {
|
|
65
|
+
buildNameTraceLookup,
|
|
66
|
+
LITERAL_NAME_STRATEGIES,
|
|
67
|
+
nameTraceKey,
|
|
68
|
+
type NameTraceabilityArtifact,
|
|
69
|
+
type NameTraceEntry,
|
|
70
|
+
type NameTraceLookup,
|
|
71
|
+
type NameTraceSourceLocation
|
|
72
|
+
} from "../contracts/name-traceability.ts";
|
|
73
|
+
import type { SourceFact, SourceFactsArtifact } from "../contracts/source-facts.ts";
|
|
74
|
+
import type {
|
|
75
|
+
ReqArea,
|
|
76
|
+
ReqEffectItem,
|
|
77
|
+
ReqFeature,
|
|
78
|
+
ReqInteraction,
|
|
79
|
+
ReqInteractionTarget,
|
|
80
|
+
ReqModelArtifact,
|
|
81
|
+
ResolvedCanonicalPath,
|
|
82
|
+
UnreachableCanonicalPath
|
|
83
|
+
} from "../contracts/req-model.ts";
|
|
84
|
+
import type { SemanticLimitation } from "../contracts/semantic-completeness.ts";
|
|
85
|
+
|
|
86
|
+
const INDENT = " ";
|
|
87
|
+
const HEX_HASH = /^[0-9a-f]{10,}$/i;
|
|
88
|
+
|
|
89
|
+
function pad(depth: number): string {
|
|
90
|
+
return INDENT.repeat(depth);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/** `tag:caseId/subkind/hash` -> `tag:hash6` (subkind duplicates {kind}, the
|
|
94
|
+
* hash alone is the only part that is actually unique per entity); ids with
|
|
95
|
+
* no "/" or a non-hash local part pass through unchanged. */
|
|
96
|
+
function shortId(id: string): string {
|
|
97
|
+
const colon = id.indexOf(":");
|
|
98
|
+
if (colon === -1) return id;
|
|
99
|
+
const tag = id.slice(0, colon);
|
|
100
|
+
const segments = id.slice(colon + 1).split("/");
|
|
101
|
+
const local = segments[segments.length - 1] ?? "";
|
|
102
|
+
return `${tag}:${HEX_HASH.test(local) ? local.slice(0, 6) : local}`;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
function fmtSupported<T>(value: SupportedValue<T> | undefined): string {
|
|
106
|
+
if (value === undefined) return "?";
|
|
107
|
+
if (value.status === "unresolved") return `?<${shortId(value.unresolvedRef)}>`;
|
|
108
|
+
return typeof value.value === "string"
|
|
109
|
+
? `"${value.value}"`
|
|
110
|
+
: JSON.stringify(value.value);
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
/** For lists of literal values (e.g. feature option labels) — no id shortening. */
|
|
114
|
+
function fmtList(label: string, items: readonly string[], depth: number): string {
|
|
115
|
+
if (items.length === 0) return "";
|
|
116
|
+
return `\n${pad(depth)}${label}: [${items.join(", ")}]`;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/** For lists of cross-reference ids. */
|
|
120
|
+
function fmtRefList(label: string, refs: readonly string[], depth: number): string {
|
|
121
|
+
if (refs.length === 0) return "";
|
|
122
|
+
return `\n${pad(depth)}${label}: [${refs.map(shortId).join(", ")}]`;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
function fmtTextItems(
|
|
126
|
+
label: string,
|
|
127
|
+
items: readonly { readonly id: string; readonly text: string }[],
|
|
128
|
+
depth: number
|
|
129
|
+
): string {
|
|
130
|
+
if (items.length === 0) return "";
|
|
131
|
+
const lines = items.map((item) => `\n${pad(depth + 1)}- ${item.text} <${shortId(item.id)}>`);
|
|
132
|
+
return `\n${pad(depth)}${label}:` + lines.join("");
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
function fmtAlternatives(
|
|
136
|
+
alternatives: readonly ConditionAlternative[] | undefined,
|
|
137
|
+
depth: number
|
|
138
|
+
): string {
|
|
139
|
+
if (!alternatives || alternatives.length === 0) return "";
|
|
140
|
+
const lines = alternatives.map(
|
|
141
|
+
(alt, index) =>
|
|
142
|
+
`\n${pad(depth + 1)}OR[${index}]: [${alt.conditionRefs.map(shortId).join(", ")}]`
|
|
143
|
+
);
|
|
144
|
+
return `\n${pad(depth)}alternatives:` + lines.join("");
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
function dumpUnresolved(items: readonly UnresolvedItem[]): string {
|
|
148
|
+
if (items.length === 0) return "Unresolved: none";
|
|
149
|
+
const lines = [`Unresolved (${items.length}):`];
|
|
150
|
+
for (const item of items) {
|
|
151
|
+
lines.push(
|
|
152
|
+
`${pad(1)}<${shortId(item.id)}> <${shortId(item.ownerRef)}> ${item.fieldPath} ` +
|
|
153
|
+
`${item.reasonCode}: ${item.message}`
|
|
154
|
+
);
|
|
155
|
+
}
|
|
156
|
+
return lines.join("\n");
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
function indexBy<T extends { readonly id: string }>(items: readonly T[]): Map<string, T> {
|
|
160
|
+
return new Map(items.map((item) => [item.id, item]));
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
function edgeKey(sourceAreaRef: string, controlRef: string, actionRef: string): string {
|
|
164
|
+
return `${sourceAreaRef}::${controlRef}::${actionRef}`;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
// ---------------------------------------------------------------------------
|
|
168
|
+
// AreaGraph
|
|
169
|
+
// ---------------------------------------------------------------------------
|
|
170
|
+
|
|
171
|
+
export interface SourceFactsIndex {
|
|
172
|
+
readonly factsById: Map<string, SourceFact>;
|
|
173
|
+
readonly evidenceById: Map<string, SourceFactsArtifact["evidence"][number]>;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
export function buildSourceFactsIndex(
|
|
177
|
+
sourceFacts: SourceFactsArtifact | undefined
|
|
178
|
+
): SourceFactsIndex | undefined {
|
|
179
|
+
if (!sourceFacts) return undefined;
|
|
180
|
+
return {
|
|
181
|
+
factsById: indexBy(sourceFacts.facts),
|
|
182
|
+
evidenceById: indexBy(sourceFacts.evidence)
|
|
183
|
+
};
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/** The first `component` SourceFact reachable from an Area/Control/Action's
|
|
187
|
+
* own `sourceFactRefs` — the JVM/Compose declaration the entity was lifted
|
|
188
|
+
* from, when the run's source-facts.json was supplied to the dump. */
|
|
189
|
+
function componentFact(
|
|
190
|
+
sourceFactRefs: readonly string[],
|
|
191
|
+
idx: SourceFactsIndex
|
|
192
|
+
): SourceFact<"component"> | undefined {
|
|
193
|
+
for (const ref of sourceFactRefs) {
|
|
194
|
+
const fact = idx.factsById.get(ref);
|
|
195
|
+
if (fact && fact.kind === "component") return fact as SourceFact<"component">;
|
|
196
|
+
}
|
|
197
|
+
return undefined;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
type SourceEvidence = SourceFactsArtifact["evidence"][number];
|
|
201
|
+
|
|
202
|
+
function basename(path: string): string {
|
|
203
|
+
const index = Math.max(path.lastIndexOf("/"), path.lastIndexOf("\\"));
|
|
204
|
+
return index === -1 ? path : path.slice(index + 1);
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
/** Basenames shared by more than one distinct full path within a given
|
|
208
|
+
* `@Anchor` universe (one dump() call): those must keep their full path to
|
|
209
|
+
* stay unambiguous, every other anchor in that same universe can shorten to
|
|
210
|
+
* its basename alone. Deeply nested paths that only ever differ by directory
|
|
211
|
+
* (e.g. every merged-manifest candidate) collapse to one readable line. */
|
|
212
|
+
function collidingBasenames(paths: Iterable<string>): ReadonlySet<string> {
|
|
213
|
+
const byBasename = new Map<string, Set<string>>();
|
|
214
|
+
for (const path of paths) {
|
|
215
|
+
const name = basename(path);
|
|
216
|
+
const fullPaths = byBasename.get(name) ?? new Set<string>();
|
|
217
|
+
fullPaths.add(path);
|
|
218
|
+
byBasename.set(name, fullPaths);
|
|
219
|
+
}
|
|
220
|
+
const collisions = new Set<string>();
|
|
221
|
+
for (const [name, fullPaths] of byBasename) {
|
|
222
|
+
if (fullPaths.size > 1) collisions.add(name);
|
|
223
|
+
}
|
|
224
|
+
return collisions;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
/** `path:startLine-endLine`, degrading to `path:startLine` for a single-line
|
|
228
|
+
* range. `path` is the file's basename unless it collides with another
|
|
229
|
+
* distinct full path in `collisions` (see `collidingBasenames`), in which
|
|
230
|
+
* case the full path (relative to the project root, matching evidence.path/
|
|
231
|
+
* SourceLocation.path) is kept so the anchor stays unambiguous. Omitting
|
|
232
|
+
* `collisions` (no known universe to check against) keeps the full path.
|
|
233
|
+
* This is the `@Anchor` token's payload (DEVELOPER.md). */
|
|
234
|
+
function fmtAnchorLocation(location: SourceLocation, collisions?: ReadonlySet<string>): string {
|
|
235
|
+
const { path, range } = location;
|
|
236
|
+
const name = basename(path);
|
|
237
|
+
const displayPath = collisions !== undefined && !collisions.has(name) ? name : path;
|
|
238
|
+
return range.startLine === range.endLine
|
|
239
|
+
? `${displayPath}:${range.startLine}`
|
|
240
|
+
: `${displayPath}:${range.startLine}-${range.endLine}`;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
/** Inline `@Anchor` token, per DEVELOPER.md's common shape: same line as the
|
|
244
|
+
* entity header, right after its `"text"` (or `{kind}` when there is no
|
|
245
|
+
* "text"), before any trailing `->`. */
|
|
246
|
+
function fmtAnchor(location: SourceLocation | undefined, collisions?: ReadonlySet<string>): string {
|
|
247
|
+
if (!location) return "";
|
|
248
|
+
return ` @${fmtAnchorLocation(location, collisions)}`;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
/** Prefers the evidence backing the class declaration itself over incidental
|
|
252
|
+
* support entries (manifest merger, layout binding, ...). */
|
|
253
|
+
function preferredEvidence(fact: SourceFact, idx: SourceFactsIndex): SourceEvidence | undefined {
|
|
254
|
+
const preferred = fact.support.find((link) => link.role.includes("class declaration"))
|
|
255
|
+
?? fact.support[0];
|
|
256
|
+
return preferred ? idx.evidenceById.get(preferred.evidenceRef) : undefined;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
/** `Symbol` token (DEVELOPER.md): "prefer className = functionName > other
|
|
260
|
+
* source code symbols. Short Name, not Qualified Name" — strips package
|
|
261
|
+
* qualification and parameter lists down to the bare identifier:
|
|
262
|
+
* "com.foo.Bar#baz(int)" -> "baz" (function wins over its class), "com.foo.Bar"
|
|
263
|
+
* -> "Bar", "@id/ivClose" -> "ivClose". */
|
|
264
|
+
export function shortSymbol(raw: string): string {
|
|
265
|
+
const withoutIdPrefix = raw.replace(/^@id\//u, "");
|
|
266
|
+
const hashIndex = withoutIdPrefix.indexOf("#");
|
|
267
|
+
if (hashIndex === -1) {
|
|
268
|
+
const segments = withoutIdPrefix.split(".");
|
|
269
|
+
return segments[segments.length - 1] || withoutIdPrefix;
|
|
270
|
+
}
|
|
271
|
+
return withoutIdPrefix.slice(hashIndex + 1).replace(/\([^]*\)\s*$/u, "");
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
export interface SourceIdentity {
|
|
275
|
+
readonly symbol?: string;
|
|
276
|
+
readonly evidence?: SourceLocation;
|
|
277
|
+
}
|
|
278
|
+
|
|
279
|
+
/** Area/Control identity from a matching name-traceability.json entry —
|
|
280
|
+
* the precomputed, ranked identity decision the fused worker grounds on,
|
|
281
|
+
* preferred over the source-facts-only
|
|
282
|
+
* heuristic below because that heuristic has no visibility into competing
|
|
283
|
+
* candidates (an Area backed by both an Activity and a hosted composable can
|
|
284
|
+
* pick the composable's generic name over the Activity's real one — see
|
|
285
|
+
* DEVELOPER.md's WebActivity/Content case). Only a code-origin selected
|
|
286
|
+
* strategy counts: a literal UI-text strategy (LITERAL_NAME_STRATEGIES) means
|
|
287
|
+
* this entity's *name* came from real text, not a code symbol — nothing to
|
|
288
|
+
* borrow here, so the source-facts heuristic still owns Symbol/@Anchor. */
|
|
289
|
+
function identityFromNameTrace(entry: NameTraceEntry | undefined): SourceIdentity | undefined {
|
|
290
|
+
if (!entry) return undefined;
|
|
291
|
+
const selected = entry.attempts.find((attempt) => attempt.outcome === "selected");
|
|
292
|
+
if (!selected?.rawValue || LITERAL_NAME_STRATEGIES.has(selected.strategy)) return undefined;
|
|
293
|
+
const selectedLocations = entry.sourceLocations.filter((location) => location.usage === "selected");
|
|
294
|
+
const preferred: NameTraceSourceLocation | undefined =
|
|
295
|
+
selectedLocations.find((location) => location.symbol !== undefined) ?? selectedLocations[0];
|
|
296
|
+
return { symbol: selected.rawValue, evidence: preferred };
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
/** Tier 1 — className#functionName (or bare #functionName when the owning
|
|
300
|
+
* class can't be resolved): the `symbol` an analyzer attached to the
|
|
301
|
+
* evidence itself backing one of this entity's own SourceFacts. Covers
|
|
302
|
+
* ~100% of JVM/Compose-backed Controls/Actions/Effects (verified against
|
|
303
|
+
* suvinemusicx/latest); XML-declared entities have no evidence.symbol. */
|
|
304
|
+
function symbolFromOwnEvidence(
|
|
305
|
+
sourceFactRefs: readonly string[],
|
|
306
|
+
idx: SourceFactsIndex
|
|
307
|
+
): SourceIdentity | undefined {
|
|
308
|
+
for (const ref of sourceFactRefs) {
|
|
309
|
+
const fact = idx.factsById.get(ref);
|
|
310
|
+
if (!fact) continue;
|
|
311
|
+
for (const support of fact.support) {
|
|
312
|
+
const evidence = idx.evidenceById.get(support.evidenceRef);
|
|
313
|
+
if (evidence?.symbol) return { symbol: evidence.symbol, evidence };
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
return undefined;
|
|
317
|
+
}
|
|
318
|
+
|
|
319
|
+
/** Tier 1 continued — Actions/Effects reference an `interaction-binding` or
|
|
320
|
+
* `behavior-effect` fact rather than the `callback` fact directly; follow
|
|
321
|
+
* `callbackKey` one hop to reach the owning method's symbol/evidence. */
|
|
322
|
+
function symbolViaCallback(
|
|
323
|
+
sourceFactRefs: readonly string[],
|
|
324
|
+
idx: SourceFactsIndex
|
|
325
|
+
): SourceIdentity | undefined {
|
|
326
|
+
for (const ref of sourceFactRefs) {
|
|
327
|
+
const callbackKey = (idx.factsById.get(ref)?.data as { callbackKey?: string } | undefined)
|
|
328
|
+
?.callbackKey;
|
|
329
|
+
if (!callbackKey) continue;
|
|
330
|
+
const callback = idx.factsById.get(callbackKey);
|
|
331
|
+
if (!callback) continue;
|
|
332
|
+
const direct = symbolFromOwnEvidence([callback.id], idx);
|
|
333
|
+
if (direct) return direct;
|
|
334
|
+
const callableSymbol = (callback.data as { callableSymbol?: string }).callableSymbol;
|
|
335
|
+
if (callableSymbol) return { symbol: callableSymbol, evidence: preferredEvidence(callback, idx) };
|
|
336
|
+
}
|
|
337
|
+
return undefined;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
/** Tier 2 — other source code symbols: declaration-time identifiers that
|
|
341
|
+
* aren't a class/method symbol (XML view id, icon/content-description
|
|
342
|
+
* anchors) for entities an analyzer can't attach JVM symbol evidence to. */
|
|
343
|
+
function otherCodeSymbol(
|
|
344
|
+
sourceFactRefs: readonly string[],
|
|
345
|
+
idx: SourceFactsIndex
|
|
346
|
+
): SourceIdentity | undefined {
|
|
347
|
+
for (const ref of sourceFactRefs) {
|
|
348
|
+
const fact = idx.factsById.get(ref);
|
|
349
|
+
if (!fact) continue;
|
|
350
|
+
const evidence = preferredEvidence(fact, idx);
|
|
351
|
+
if (fact.kind === "ui-element") {
|
|
352
|
+
const data = fact.data as { symbol?: string; resourceId?: string };
|
|
353
|
+
const symbol = data.symbol ?? data.resourceId;
|
|
354
|
+
if (symbol) return { symbol, evidence };
|
|
355
|
+
}
|
|
356
|
+
if (fact.kind === "callback") {
|
|
357
|
+
const callableSymbol = (fact.data as { callableSymbol?: string }).callableSymbol;
|
|
358
|
+
if (callableSymbol) return { symbol: callableSymbol, evidence };
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
return undefined;
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
/** Tier 3 — source code anchor only: the first evidence location reachable
|
|
365
|
+
* from this entity's own sourceFactRefs, no symbol identity attached. */
|
|
366
|
+
function anchorOnly(
|
|
367
|
+
sourceFactRefs: readonly string[],
|
|
368
|
+
idx: SourceFactsIndex
|
|
369
|
+
): SourceIdentity | undefined {
|
|
370
|
+
for (const ref of sourceFactRefs) {
|
|
371
|
+
const fact = idx.factsById.get(ref);
|
|
372
|
+
if (!fact) continue;
|
|
373
|
+
const evidence = preferredEvidence(fact, idx);
|
|
374
|
+
if (evidence) return { evidence };
|
|
375
|
+
}
|
|
376
|
+
return undefined;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
/**
|
|
380
|
+
* Control/Action/Effect source identity, most to least preferred (per
|
|
381
|
+
* DEVELOPER.md): className#functionName evidence symbol > the same one hop
|
|
382
|
+
* through a callback reference > other declaration-time symbols (XML view
|
|
383
|
+
* id, ...) > a bare source anchor (path:line[-line]), no symbol at all.
|
|
384
|
+
*/
|
|
385
|
+
export function resolveSourceIdentity(
|
|
386
|
+
sourceFactRefs: readonly string[],
|
|
387
|
+
idx: SourceFactsIndex
|
|
388
|
+
): SourceIdentity {
|
|
389
|
+
return symbolFromOwnEvidence(sourceFactRefs, idx)
|
|
390
|
+
?? symbolViaCallback(sourceFactRefs, idx)
|
|
391
|
+
?? otherCodeSymbol(sourceFactRefs, idx)
|
|
392
|
+
?? anchorOnly(sourceFactRefs, idx)
|
|
393
|
+
?? {};
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
/**
|
|
397
|
+
* Area identity: name-traceability's ranked decision first (see
|
|
398
|
+
* `identityFromNameTrace`), falling back to its own `component` SourceFact's
|
|
399
|
+
* qualifiedName directly, falling back further to the generic tiered
|
|
400
|
+
* resolver used by Control/Action/Effect. Takes the raw ref/sourceFactRefs
|
|
401
|
+
* pair rather than an `Area` object so ReqModel's ReqArea — which carries
|
|
402
|
+
* the same `areaRef` and a superset `supportRefs` merging the Area's own
|
|
403
|
+
* sourceFactRefs with its Controls' (see analysis/req-model/build.ts) — can
|
|
404
|
+
* resolve the identical identity without needing the AreaGraph at all. */
|
|
405
|
+
export function areaSourceIdentity(
|
|
406
|
+
sourceFactRefs: readonly string[],
|
|
407
|
+
areaRef: string,
|
|
408
|
+
sourceFacts: SourceFactsIndex | undefined,
|
|
409
|
+
nameTrace: NameTraceLookup | undefined
|
|
410
|
+
): SourceIdentity {
|
|
411
|
+
const fromNameTrace = identityFromNameTrace(nameTrace?.get(nameTraceKey("area", areaRef)));
|
|
412
|
+
if (fromNameTrace) return fromNameTrace;
|
|
413
|
+
if (!sourceFacts) return {};
|
|
414
|
+
const component = componentFact(sourceFactRefs, sourceFacts);
|
|
415
|
+
return component
|
|
416
|
+
? { symbol: component.data.qualifiedName, evidence: preferredEvidence(component, sourceFacts) }
|
|
417
|
+
: resolveSourceIdentity(sourceFactRefs, sourceFacts);
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
/** Control identity: name-traceability's ranked decision first, falling back
|
|
421
|
+
* to the generic tiered resolver used by Action/Effect. Same ref/
|
|
422
|
+
* sourceFactRefs-pair shape as `areaSourceIdentity`, for the same reason:
|
|
423
|
+
* ReqModel's ReqFeature carries `controlRef` + a superset `supportRefs`. */
|
|
424
|
+
function controlSourceIdentity(
|
|
425
|
+
sourceFactRefs: readonly string[],
|
|
426
|
+
controlRef: string,
|
|
427
|
+
sourceFacts: SourceFactsIndex | undefined,
|
|
428
|
+
nameTrace: NameTraceLookup | undefined
|
|
429
|
+
): SourceIdentity {
|
|
430
|
+
const fromNameTrace = identityFromNameTrace(nameTrace?.get(nameTraceKey("control", controlRef)));
|
|
431
|
+
if (fromNameTrace) return fromNameTrace;
|
|
432
|
+
return sourceFacts ? resolveSourceIdentity(sourceFactRefs, sourceFacts) : {};
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
/** `Symbol ` prefix for an entity's header line (empty when unresolved). */
|
|
436
|
+
function fmtSymbolPrefix(identity: SourceIdentity): string {
|
|
437
|
+
return identity.symbol ? `${shortSymbol(identity.symbol)} ` : "";
|
|
438
|
+
}
|
|
439
|
+
|
|
440
|
+
interface AreaGraphIndex {
|
|
441
|
+
readonly areasById: Map<string, Area>;
|
|
442
|
+
readonly controlsById: Map<string, Control>;
|
|
443
|
+
readonly actionsById: Map<string, Action>;
|
|
444
|
+
readonly effectsById: Map<string, Effect>;
|
|
445
|
+
readonly externalsById: Map<string, ExternalEndpoint>;
|
|
446
|
+
readonly edgesByKey: Map<string, Edge[]>;
|
|
447
|
+
readonly sourceFacts?: SourceFactsIndex;
|
|
448
|
+
readonly nameTrace?: NameTraceLookup;
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
function buildAreaGraphIndex(
|
|
452
|
+
graph: AreaGraphView,
|
|
453
|
+
sourceFacts: SourceFactsArtifact | undefined,
|
|
454
|
+
nameTraceability: NameTraceabilityArtifact | undefined
|
|
455
|
+
): AreaGraphIndex {
|
|
456
|
+
const edgesByKey = new Map<string, Edge[]>();
|
|
457
|
+
for (const edge of graph.edges) {
|
|
458
|
+
const key = edgeKey(edge.sourceAreaRef, edge.controlRef, edge.actionRef);
|
|
459
|
+
const bucket = edgesByKey.get(key);
|
|
460
|
+
if (bucket) {
|
|
461
|
+
bucket.push(edge);
|
|
462
|
+
} else {
|
|
463
|
+
edgesByKey.set(key, [edge]);
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
return {
|
|
467
|
+
areasById: indexBy(graph.areas),
|
|
468
|
+
controlsById: indexBy(graph.controls),
|
|
469
|
+
actionsById: indexBy(graph.actions),
|
|
470
|
+
effectsById: indexBy(graph.effects),
|
|
471
|
+
externalsById: indexBy(graph.externalEndpoints),
|
|
472
|
+
edgesByKey,
|
|
473
|
+
sourceFacts: buildSourceFactsIndex(sourceFacts),
|
|
474
|
+
nameTrace: nameTraceability ? buildNameTraceLookup(nameTraceability.entries) : undefined
|
|
475
|
+
};
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
/** `-> <area:id> "name" {kind}`, kind omitted when the target isn't in this graph. */
|
|
479
|
+
function fmtAreaRef(ref: string, area: Area | undefined): string {
|
|
480
|
+
const kind = area ? ` {${area.kind}}` : "";
|
|
481
|
+
return `<${shortId(ref)}> ${area ? fmtSupported(area.name) : "?"}${kind}`;
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
function dumpEdgeTarget(edge: Edge, idx: AreaGraphIndex, depth: number): string {
|
|
485
|
+
const target = edge.target;
|
|
486
|
+
let out: string;
|
|
487
|
+
if ("unresolvedRef" in target) {
|
|
488
|
+
out = `\n${pad(depth)}-> ?<${shortId(target.unresolvedRef)}>`;
|
|
489
|
+
} else if (target.kind === "area") {
|
|
490
|
+
out = `\n${pad(depth)}-> ${fmtAreaRef(target.ref, idx.areasById.get(target.ref))}`;
|
|
491
|
+
} else {
|
|
492
|
+
const external = idx.externalsById.get(target.ref);
|
|
493
|
+
const kind = external ? ` {${external.kind}}` : "";
|
|
494
|
+
out = `\n${pad(depth)}-> <${shortId(target.ref)}> ${external ? fmtSupported(external.name) : "?"}${kind}`;
|
|
495
|
+
}
|
|
496
|
+
out += fmtRefList("when", edge.conditions, depth + 1);
|
|
497
|
+
out += fmtAlternatives(edge.conditionAlternatives, depth + 1);
|
|
498
|
+
return out;
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
function dumpEffect(
|
|
502
|
+
effect: Effect,
|
|
503
|
+
idx: AreaGraphIndex,
|
|
504
|
+
depth: number,
|
|
505
|
+
collisions: ReadonlySet<string>
|
|
506
|
+
): string {
|
|
507
|
+
const identity = idx.sourceFacts ? resolveSourceIdentity(effect.sourceFactRefs, idx.sourceFacts) : {};
|
|
508
|
+
const tags = [
|
|
509
|
+
effect.kind,
|
|
510
|
+
effect.closePolicy ? `close=${effect.closePolicy}` : undefined,
|
|
511
|
+
effect.transitionMode ? `transition=${effect.transitionMode}` : undefined,
|
|
512
|
+
effect.stateKey ? `state=${fmtSupported(effect.stateKey)}` : undefined,
|
|
513
|
+
effect.value !== undefined ? `value=${fmtSupported(effect.value)}` : undefined
|
|
514
|
+
].filter((tag): tag is string => tag !== undefined);
|
|
515
|
+
let out = `\n${pad(depth)}<${shortId(effect.id)}> ${fmtSymbolPrefix(identity)}` +
|
|
516
|
+
`{${tags.join(", ")}} ${fmtSupported(effect.description)}${fmtAnchor(identity.evidence, collisions)}`;
|
|
517
|
+
out += fmtAlternatives(effect.conditionAlternatives, depth + 1);
|
|
518
|
+
out += fmtRefList("unresolved", effect.unresolvedRefs ?? [], depth + 1);
|
|
519
|
+
return out;
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
function dumpAction(
|
|
523
|
+
action: Action,
|
|
524
|
+
sourceAreaRef: string,
|
|
525
|
+
idx: AreaGraphIndex,
|
|
526
|
+
depth: number,
|
|
527
|
+
collisions: ReadonlySet<string>
|
|
528
|
+
): string {
|
|
529
|
+
const identity = idx.sourceFacts ? resolveSourceIdentity(action.sourceFactRefs, idx.sourceFacts) : {};
|
|
530
|
+
let out = `\n${pad(depth)}<${shortId(action.id)}> ${fmtSymbolPrefix(identity)}` +
|
|
531
|
+
`{${action.trigger}}${fmtAnchor(identity.evidence, collisions)}`;
|
|
532
|
+
out += fmtRefList("pre", action.preconditionRefs, depth + 1);
|
|
533
|
+
out += fmtAlternatives(action.preconditionAlternatives, depth + 1);
|
|
534
|
+
for (const ref of action.effectRefs) {
|
|
535
|
+
const effect = idx.effectsById.get(ref);
|
|
536
|
+
if (effect) out += dumpEffect(effect, idx, depth + 1, collisions);
|
|
537
|
+
}
|
|
538
|
+
const edges = idx.edgesByKey.get(edgeKey(sourceAreaRef, action.controlRef, action.id)) ?? [];
|
|
539
|
+
for (const edge of edges) {
|
|
540
|
+
out += dumpEdgeTarget(edge, idx, depth + 1);
|
|
541
|
+
}
|
|
542
|
+
return out;
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
function dumpControl(
|
|
546
|
+
control: Control,
|
|
547
|
+
idx: AreaGraphIndex,
|
|
548
|
+
depth: number,
|
|
549
|
+
collisions: ReadonlySet<string>
|
|
550
|
+
): string {
|
|
551
|
+
const identity = controlSourceIdentity(control.sourceFactRefs, control.id, idx.sourceFacts, idx.nameTrace);
|
|
552
|
+
let out = `\n${pad(depth)}<${shortId(control.id)}> ${fmtSymbolPrefix(identity)}` +
|
|
553
|
+
`{${control.kind}} ${fmtSupported(control.name)}${fmtAnchor(identity.evidence, collisions)}`;
|
|
554
|
+
if (control.enabled) out += ` enabled=${fmtSupported(control.enabled)}`;
|
|
555
|
+
out += fmtRefList("visible-when", control.visibilityConditions, depth + 1);
|
|
556
|
+
out += fmtRefList("enabled-when", control.enabledConditions, depth + 1);
|
|
557
|
+
for (const ref of control.actionRefs) {
|
|
558
|
+
const action = idx.actionsById.get(ref);
|
|
559
|
+
if (action) out += dumpAction(action, control.areaRef, idx, depth + 1, collisions);
|
|
560
|
+
}
|
|
561
|
+
return out;
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
function dumpArea(
|
|
565
|
+
area: Area,
|
|
566
|
+
idx: AreaGraphIndex,
|
|
567
|
+
depth: number,
|
|
568
|
+
collisions: ReadonlySet<string>
|
|
569
|
+
): string {
|
|
570
|
+
const identity = areaSourceIdentity(area.sourceFactRefs, area.id, idx.sourceFacts, idx.nameTrace);
|
|
571
|
+
let out = `${pad(depth)}<${shortId(area.id)}> ${fmtSymbolPrefix(identity)}` +
|
|
572
|
+
`{${area.kind}} ${fmtSupported(area.name)}${fmtAnchor(identity.evidence, collisions)}`;
|
|
573
|
+
out += fmtRefList("conditions", area.conditions, depth + 1);
|
|
574
|
+
for (const ref of area.controlRefs) {
|
|
575
|
+
const control = idx.controlsById.get(ref);
|
|
576
|
+
if (control) out += dumpControl(control, idx, depth + 1, collisions);
|
|
577
|
+
}
|
|
578
|
+
return out;
|
|
579
|
+
}
|
|
580
|
+
|
|
581
|
+
/** Every evidence path this dump will actually render as an `@Anchor` across
|
|
582
|
+
* all Areas/Controls/Actions/Effects — the same "one dump() call" collision
|
|
583
|
+
* universe `dumpGapAudit` computes for its own candidates, reused here so
|
|
584
|
+
* `collidingBasenames` decides full-path-vs-basename consistently. */
|
|
585
|
+
function allSourceEvidencePaths(graph: AreaGraphView, idx: AreaGraphIndex): string[] {
|
|
586
|
+
const paths: string[] = [];
|
|
587
|
+
const collect = (identity: SourceIdentity): void => {
|
|
588
|
+
if (identity.evidence) paths.push(identity.evidence.path);
|
|
589
|
+
};
|
|
590
|
+
for (const area of graph.areas) {
|
|
591
|
+
collect(areaSourceIdentity(area.sourceFactRefs, area.id, idx.sourceFacts, idx.nameTrace));
|
|
592
|
+
}
|
|
593
|
+
for (const control of graph.controls) {
|
|
594
|
+
collect(controlSourceIdentity(control.sourceFactRefs, control.id, idx.sourceFacts, idx.nameTrace));
|
|
595
|
+
}
|
|
596
|
+
if (idx.sourceFacts) {
|
|
597
|
+
for (const action of graph.actions) collect(resolveSourceIdentity(action.sourceFactRefs, idx.sourceFacts));
|
|
598
|
+
for (const effect of graph.effects) collect(resolveSourceIdentity(effect.sourceFactRefs, idx.sourceFacts));
|
|
599
|
+
}
|
|
600
|
+
return paths;
|
|
601
|
+
}
|
|
602
|
+
|
|
603
|
+
function dumpEntryPoint(entry: EntryPoint, idx: AreaGraphIndex): string {
|
|
604
|
+
const roots = entry.rootAreaRefs
|
|
605
|
+
.map((ref) => fmtAreaRef(ref, idx.areasById.get(ref)))
|
|
606
|
+
.join(", ");
|
|
607
|
+
return `${pad(1)}<${shortId(entry.id)}> {${entry.kind}, ${entry.category}} -> ${roots}`;
|
|
608
|
+
}
|
|
609
|
+
|
|
610
|
+
/**
|
|
611
|
+
* Dumps an AreaGraphView as an indented tree instead of JSON. Passing the
|
|
612
|
+
* matching source-facts.json (same run) additionally resolves each
|
|
613
|
+
* Area/Control/Action/Effect's `Symbol` (short className/functionName) and
|
|
614
|
+
* `@Anchor` (declaration location) per DEVELOPER.md. Passing the matching
|
|
615
|
+
* name-traceability.json (same run) further overrides Area/Control's Symbol/
|
|
616
|
+
* @Anchor with its precomputed, ranked identity decision when one exists —
|
|
617
|
+
* see `identityFromNameTrace`; Action/Effect have no name-traceability
|
|
618
|
+
* coverage and always use the source-facts heuristic. Omitting both, dump
|
|
619
|
+
* renders exactly as before, with no Symbol/Anchor.
|
|
620
|
+
*/
|
|
621
|
+
export function dumpAreaGraph(
|
|
622
|
+
graph: AreaGraphView,
|
|
623
|
+
sourceFacts?: SourceFactsArtifact,
|
|
624
|
+
nameTraceability?: NameTraceabilityArtifact
|
|
625
|
+
): string {
|
|
626
|
+
const idx = buildAreaGraphIndex(graph, sourceFacts, nameTraceability);
|
|
627
|
+
const collisions = collidingBasenames(allSourceEvidencePaths(graph, idx));
|
|
628
|
+
const lines: string[] = [];
|
|
629
|
+
lines.push(
|
|
630
|
+
`AreaGraph <${graph.caseId}> [${graph.analysisContext.applicationModule}:${graph.analysisContext.buildVariant}]`
|
|
631
|
+
);
|
|
632
|
+
|
|
633
|
+
lines.push("Entry Points:");
|
|
634
|
+
for (const entry of graph.entryPoints) lines.push(dumpEntryPoint(entry, idx));
|
|
635
|
+
|
|
636
|
+
lines.push("Areas:");
|
|
637
|
+
for (const area of graph.areas) lines.push(dumpArea(area, idx, 1, collisions));
|
|
638
|
+
|
|
639
|
+
if (graph.excludedAreaCandidates && graph.excludedAreaCandidates.length > 0) {
|
|
640
|
+
lines.push("Excluded Area Candidates:");
|
|
641
|
+
for (const candidate of graph.excludedAreaCandidates) {
|
|
642
|
+
lines.push(
|
|
643
|
+
`${pad(1)}<${shortId(candidate.componentRef)}> excluded: ${candidate.reasonCode} - ${candidate.reason}`
|
|
644
|
+
);
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
if (graph.externalEndpoints.length > 0) {
|
|
649
|
+
lines.push("External Endpoints:");
|
|
650
|
+
for (const external of graph.externalEndpoints) {
|
|
651
|
+
lines.push(`${pad(1)}<${shortId(external.id)}> {${external.kind}} ${fmtSupported(external.name)}`);
|
|
652
|
+
}
|
|
653
|
+
}
|
|
654
|
+
|
|
655
|
+
lines.push(dumpUnresolved(graph.unresolved));
|
|
656
|
+
return lines.join("\n");
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
// ---------------------------------------------------------------------------
|
|
660
|
+
// ReqModel
|
|
661
|
+
// ---------------------------------------------------------------------------
|
|
662
|
+
|
|
663
|
+
function dumpCanonicalPath(
|
|
664
|
+
path: ResolvedCanonicalPath | UnreachableCanonicalPath | { readonly status: "unresolved"; readonly unresolvedRef: string },
|
|
665
|
+
depth: number
|
|
666
|
+
): string {
|
|
667
|
+
if (path.status === "unresolved") return `\n${pad(depth)}path: ?<${shortId(path.unresolvedRef)}>`;
|
|
668
|
+
if (path.status === "unreachable") {
|
|
669
|
+
const alternates = path.alternatePathRefs.length > 0
|
|
670
|
+
? path.alternatePathRefs.map(shortId).join(", ")
|
|
671
|
+
: "none";
|
|
672
|
+
return `\n${pad(depth)}path: unreachable (alternates: ${alternates})`;
|
|
673
|
+
}
|
|
674
|
+
if (path.segments.length === 0) {
|
|
675
|
+
return `\n${pad(depth)}path (${path.reachability}): (self)`;
|
|
676
|
+
}
|
|
677
|
+
let chain = path.segments[0]?.areaName ?? "?";
|
|
678
|
+
for (const segment of path.segments) {
|
|
679
|
+
const label = segment.controlName && segment.action
|
|
680
|
+
? `${segment.controlName}: ${segment.action}`
|
|
681
|
+
: segment.action ?? "";
|
|
682
|
+
chain += ` -[${label}]-> ${segment.targetAreaName ?? "?"}`;
|
|
683
|
+
}
|
|
684
|
+
return `\n${pad(depth)}path (${path.reachability}): ${chain}`;
|
|
685
|
+
}
|
|
686
|
+
|
|
687
|
+
function dumpReqTarget(target: ReqInteractionTarget | undefined, depth: number): string {
|
|
688
|
+
if (!target) return "";
|
|
689
|
+
if ("unresolvedRef" in target) return `\n${pad(depth)}-> ?<${shortId(target.unresolvedRef)}>`;
|
|
690
|
+
switch (target.kind) {
|
|
691
|
+
case "area":
|
|
692
|
+
return `\n${pad(depth)}-> <${shortId(target.ref)}> ${fmtSupported(target.displayName)}`;
|
|
693
|
+
case "external":
|
|
694
|
+
return `\n${pad(depth)}-> <${shortId(target.ref)}> ${fmtSupported(target.displayName)}`;
|
|
695
|
+
case "history-back":
|
|
696
|
+
return `\n${pad(depth)}-> history-back [${target.refs.map(shortId).join(", ")}] ${fmtSupported(target.displayName)}`;
|
|
697
|
+
case "conditional-area-set": {
|
|
698
|
+
let out = `\n${pad(depth)}-> one-of ${fmtSupported(target.displayName)}`;
|
|
699
|
+
if (target.branches) {
|
|
700
|
+
for (const branch of target.branches) {
|
|
701
|
+
out += `\n${pad(depth + 1)}<${shortId(branch.ref)}>`;
|
|
702
|
+
out += fmtTextItems("when", branch.conditions, depth + 2);
|
|
703
|
+
}
|
|
704
|
+
} else {
|
|
705
|
+
out += fmtRefList("candidates", target.refs, depth + 1);
|
|
706
|
+
}
|
|
707
|
+
return out;
|
|
708
|
+
}
|
|
709
|
+
case "alternative-target-set": {
|
|
710
|
+
let out = `\n${pad(depth)}-> alternatives ${fmtSupported(target.displayName)}`;
|
|
711
|
+
for (const branch of target.branches) {
|
|
712
|
+
out += dumpReqTarget(branch.target, depth + 1);
|
|
713
|
+
out += fmtTextItems("when", branch.conditions, depth + 2);
|
|
714
|
+
}
|
|
715
|
+
return out;
|
|
716
|
+
}
|
|
717
|
+
}
|
|
718
|
+
}
|
|
719
|
+
|
|
720
|
+
interface ReqModelIndex {
|
|
721
|
+
readonly sourceFacts?: SourceFactsIndex;
|
|
722
|
+
readonly nameTrace?: NameTraceLookup;
|
|
723
|
+
/** Present only when the matching area-graph.json was also supplied — the
|
|
724
|
+
* exact Area/Control/Action objects, so identity resolves from their own
|
|
725
|
+
* `sourceFactRefs` instead of ReqArea/ReqFeature/ReqInteraction's broader
|
|
726
|
+
* `supportRefs` (which merges in nested children's refs too, see
|
|
727
|
+
* analysis/req-model/build.ts — precise enough for ReqEffectItem, whose
|
|
728
|
+
* `supportRefs` is exactly the underlying Effect's `sourceFactRefs` with
|
|
729
|
+
* nothing merged in, but not for Area/Control/Interaction). */
|
|
730
|
+
readonly areasById?: ReadonlyMap<string, Area>;
|
|
731
|
+
readonly controlsById?: ReadonlyMap<string, Control>;
|
|
732
|
+
readonly actionsById?: ReadonlyMap<string, Action>;
|
|
733
|
+
}
|
|
734
|
+
|
|
735
|
+
function buildReqModelIndex(
|
|
736
|
+
graph: AreaGraphView | undefined,
|
|
737
|
+
sourceFacts: SourceFactsArtifact | undefined,
|
|
738
|
+
nameTraceability: NameTraceabilityArtifact | undefined
|
|
739
|
+
): ReqModelIndex {
|
|
740
|
+
return {
|
|
741
|
+
sourceFacts: buildSourceFactsIndex(sourceFacts),
|
|
742
|
+
nameTrace: nameTraceability ? buildNameTraceLookup(nameTraceability.entries) : undefined,
|
|
743
|
+
areasById: graph ? indexBy(graph.areas) : undefined,
|
|
744
|
+
controlsById: graph ? indexBy(graph.controls) : undefined,
|
|
745
|
+
actionsById: graph ? indexBy(graph.actions) : undefined
|
|
746
|
+
};
|
|
747
|
+
}
|
|
748
|
+
|
|
749
|
+
function reqAreaIdentity(area: ReqArea, idx: ReqModelIndex): SourceIdentity {
|
|
750
|
+
const graphArea = idx.areasById?.get(area.areaRef);
|
|
751
|
+
return graphArea
|
|
752
|
+
? areaSourceIdentity(graphArea.sourceFactRefs, graphArea.id, idx.sourceFacts, idx.nameTrace)
|
|
753
|
+
: areaSourceIdentity(area.supportRefs, area.areaRef, idx.sourceFacts, idx.nameTrace);
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
function reqFeatureIdentity(feature: ReqFeature, idx: ReqModelIndex): SourceIdentity {
|
|
757
|
+
const graphControl = idx.controlsById?.get(feature.controlRef);
|
|
758
|
+
return graphControl
|
|
759
|
+
? controlSourceIdentity(graphControl.sourceFactRefs, graphControl.id, idx.sourceFacts, idx.nameTrace)
|
|
760
|
+
: controlSourceIdentity(feature.supportRefs, feature.controlRef, idx.sourceFacts, idx.nameTrace);
|
|
761
|
+
}
|
|
762
|
+
|
|
763
|
+
/** ReqInteraction has no name-traceability coverage (only "area"/"control"
|
|
764
|
+
* entity kinds do — same as its AreaGraph Action counterpart). */
|
|
765
|
+
function reqInteractionIdentity(interaction: ReqInteraction, idx: ReqModelIndex): SourceIdentity {
|
|
766
|
+
if (!idx.sourceFacts) return {};
|
|
767
|
+
const graphAction = idx.actionsById?.get(interaction.actionRef);
|
|
768
|
+
return resolveSourceIdentity(graphAction?.sourceFactRefs ?? interaction.supportRefs, idx.sourceFacts);
|
|
769
|
+
}
|
|
770
|
+
|
|
771
|
+
/** ReqEffectItem's own `supportRefs` is exactly the underlying Effect's
|
|
772
|
+
* `sourceFactRefs` (see analysis/req-model/build.ts's `textItem` call for
|
|
773
|
+
* "feature-effect") — already precise, no graph lookup needed. */
|
|
774
|
+
function reqEffectIdentity(effect: ReqEffectItem, idx: ReqModelIndex): SourceIdentity {
|
|
775
|
+
return idx.sourceFacts ? resolveSourceIdentity(effect.supportRefs, idx.sourceFacts) : {};
|
|
776
|
+
}
|
|
777
|
+
|
|
778
|
+
function dumpReqEffect(effect: ReqEffectItem, idx: ReqModelIndex, collisions: ReadonlySet<string>, depth: number): string {
|
|
779
|
+
const identity = reqEffectIdentity(effect, idx);
|
|
780
|
+
let out = `\n${pad(depth)}<${shortId(effect.id)}> ${fmtSymbolPrefix(identity)}` +
|
|
781
|
+
`${effect.kind ? `{${effect.kind}} ` : ""}${effect.text}${fmtAnchor(identity.evidence, collisions)}`;
|
|
782
|
+
if (effect.stateKey) out += ` state=${fmtSupported(effect.stateKey)}`;
|
|
783
|
+
if (effect.value !== undefined) out += ` value=${fmtSupported(effect.value)}`;
|
|
784
|
+
return out;
|
|
785
|
+
}
|
|
786
|
+
|
|
787
|
+
function dumpReqInteraction(
|
|
788
|
+
interaction: ReqInteraction,
|
|
789
|
+
idx: ReqModelIndex,
|
|
790
|
+
collisions: ReadonlySet<string>,
|
|
791
|
+
depth: number
|
|
792
|
+
): string {
|
|
793
|
+
const identity = reqInteractionIdentity(interaction, idx);
|
|
794
|
+
let out = `\n${pad(depth)}<${shortId(interaction.id)}> ${fmtSymbolPrefix(identity)}` +
|
|
795
|
+
`{${interaction.trigger}}${fmtAnchor(identity.evidence, collisions)}`;
|
|
796
|
+
out += fmtTextItems("conditions", interaction.conditions, depth + 1);
|
|
797
|
+
for (const effect of interaction.effects) out += dumpReqEffect(effect, idx, collisions, depth + 1);
|
|
798
|
+
out += dumpReqTarget(interaction.target, depth + 1);
|
|
799
|
+
out += fmtRefList("unresolved", interaction.unresolvedRefs, depth + 1);
|
|
800
|
+
return out;
|
|
801
|
+
}
|
|
802
|
+
|
|
803
|
+
/**
|
|
804
|
+
* v1 artifacts populate only the deprecated top-level trigger/conditions/
|
|
805
|
+
* effects/target fields; synthesize one interaction so dump() still renders.
|
|
806
|
+
*/
|
|
807
|
+
export function reqFeatureInteractions(feature: ReqFeature): readonly ReqInteraction[] {
|
|
808
|
+
if (feature.interactions && feature.interactions.length > 0) return feature.interactions;
|
|
809
|
+
return [{
|
|
810
|
+
id: `${feature.id}#legacy`,
|
|
811
|
+
actionRef: feature.controlRef,
|
|
812
|
+
trigger: feature.trigger,
|
|
813
|
+
conditions: feature.conditions,
|
|
814
|
+
effects: feature.effects,
|
|
815
|
+
...(feature.target ? { target: feature.target } : {}),
|
|
816
|
+
unresolvedRefs: feature.unresolvedRefs,
|
|
817
|
+
supportRefs: feature.supportRefs
|
|
818
|
+
}];
|
|
819
|
+
}
|
|
820
|
+
|
|
821
|
+
function dumpReqFeature(feature: ReqFeature, idx: ReqModelIndex, collisions: ReadonlySet<string>, depth: number): string {
|
|
822
|
+
const identity = reqFeatureIdentity(feature, idx);
|
|
823
|
+
let out = `\n${pad(depth)}<${shortId(feature.id)}> ${fmtSymbolPrefix(identity)}` +
|
|
824
|
+
`${fmtSupported(feature.displayName)}${fmtAnchor(identity.evidence, collisions)} ` +
|
|
825
|
+
`(control=<${shortId(feature.controlRef)}>)`;
|
|
826
|
+
if (feature.enabled) out += ` enabled=${fmtSupported(feature.enabled)}`;
|
|
827
|
+
if (feature.defaultValue !== undefined) out += ` default=${fmtSupported(feature.defaultValue)}`;
|
|
828
|
+
out += fmtList("options", feature.options.map((option) => option.value), depth + 1);
|
|
829
|
+
for (const interaction of reqFeatureInteractions(feature)) {
|
|
830
|
+
out += dumpReqInteraction(interaction, idx, collisions, depth + 1);
|
|
831
|
+
}
|
|
832
|
+
return out;
|
|
833
|
+
}
|
|
834
|
+
|
|
835
|
+
function dumpReqArea(area: ReqArea, idx: ReqModelIndex, collisions: ReadonlySet<string>, depth: number): string {
|
|
836
|
+
const identity = reqAreaIdentity(area, idx);
|
|
837
|
+
let out = `${pad(depth)}<${shortId(area.id)}> ${fmtSymbolPrefix(identity)}` +
|
|
838
|
+
`${fmtSupported(area.displayName)}${fmtAnchor(identity.evidence, collisions)} ` +
|
|
839
|
+
`(area=<${shortId(area.areaRef)}>)`;
|
|
840
|
+
out += dumpCanonicalPath(area.canonicalPath, depth + 1);
|
|
841
|
+
out += fmtTextItems("preconditions", area.preconditions, depth + 1);
|
|
842
|
+
out += fmtTextItems("description", area.descriptionItems, depth + 1);
|
|
843
|
+
for (const feature of area.features) out += dumpReqFeature(feature, idx, collisions, depth + 1);
|
|
844
|
+
out += fmtRefList("unresolved", area.unresolvedRefs, depth + 1);
|
|
845
|
+
return out;
|
|
846
|
+
}
|
|
847
|
+
|
|
848
|
+
/** Every evidence path this dump will actually render as an `@Anchor` across
|
|
849
|
+
* all ReqAreas/ReqFeatures/ReqInteractions/ReqEffectItems — same collision
|
|
850
|
+
* universe pattern as `allSourceEvidencePaths` (AreaGraph) / `dumpGapAudit`. */
|
|
851
|
+
function allReqModelEvidencePaths(model: ReqModelArtifact, idx: ReqModelIndex): string[] {
|
|
852
|
+
const paths: string[] = [];
|
|
853
|
+
const collect = (identity: SourceIdentity): void => {
|
|
854
|
+
if (identity.evidence) paths.push(identity.evidence.path);
|
|
855
|
+
};
|
|
856
|
+
for (const area of model.areas) {
|
|
857
|
+
collect(reqAreaIdentity(area, idx));
|
|
858
|
+
for (const feature of area.features) {
|
|
859
|
+
collect(reqFeatureIdentity(feature, idx));
|
|
860
|
+
for (const interaction of reqFeatureInteractions(feature)) {
|
|
861
|
+
collect(reqInteractionIdentity(interaction, idx));
|
|
862
|
+
for (const effect of interaction.effects) collect(reqEffectIdentity(effect, idx));
|
|
863
|
+
}
|
|
864
|
+
}
|
|
865
|
+
}
|
|
866
|
+
return paths;
|
|
867
|
+
}
|
|
868
|
+
|
|
869
|
+
/**
|
|
870
|
+
* Dumps a ReqModelArtifact as an indented tree instead of JSON. Same Symbol/
|
|
871
|
+
* @Anchor resolution as `dumpAreaGraph`. Passing the matching area-graph.json
|
|
872
|
+
* (same run) resolves ReqArea/ReqFeature/ReqInteraction identity from the
|
|
873
|
+
* exact underlying Area/Control/Action's own `sourceFactRefs` — otherwise
|
|
874
|
+
* (area-graph.json omitted) falls back to ReqArea/ReqFeature's own broader
|
|
875
|
+
* `supportRefs`, which can occasionally pick up a nested interaction's/
|
|
876
|
+
* effect's symbol instead of the Control's own (e.g. an XML-declared Control
|
|
877
|
+
* with no JVM symbol of its own). ReqEffectItem always resolves from its own
|
|
878
|
+
* `supportRefs` (exactly the underlying Effect's `sourceFactRefs`, no graph
|
|
879
|
+
* needed). Passing the matching name-traceability.json further overrides
|
|
880
|
+
* Area/Control's Symbol/@Anchor with its precomputed, ranked identity
|
|
881
|
+
* decision when one exists (see `identityFromNameTrace`). Omitting all three,
|
|
882
|
+
* dump renders exactly as before, with no Symbol/Anchor.
|
|
883
|
+
*/
|
|
884
|
+
export function dumpReqModel(
|
|
885
|
+
model: ReqModelArtifact,
|
|
886
|
+
graph?: AreaGraphView,
|
|
887
|
+
sourceFactsArtifact?: SourceFactsArtifact,
|
|
888
|
+
nameTraceability?: NameTraceabilityArtifact
|
|
889
|
+
): string {
|
|
890
|
+
const idx = buildReqModelIndex(graph, sourceFactsArtifact, nameTraceability);
|
|
891
|
+
const collisions = collidingBasenames(allReqModelEvidencePaths(model, idx));
|
|
892
|
+
const lines: string[] = [];
|
|
893
|
+
lines.push(`ReqModel <${model.caseId}>`);
|
|
894
|
+
lines.push("Areas:");
|
|
895
|
+
for (const area of model.areas) lines.push(dumpReqArea(area, idx, collisions, 1));
|
|
896
|
+
lines.push(dumpUnresolved(model.unresolved));
|
|
897
|
+
return lines.join("\n");
|
|
898
|
+
}
|
|
899
|
+
|
|
900
|
+
// ---------------------------------------------------------------------------
|
|
901
|
+
// GapAudit
|
|
902
|
+
// ---------------------------------------------------------------------------
|
|
903
|
+
|
|
904
|
+
/** The 8 candidate-status counters shared verbatim by GapAuditSummary and
|
|
905
|
+
* each GapAuditCategory. */
|
|
906
|
+
interface CandidateCounts {
|
|
907
|
+
readonly observed: number;
|
|
908
|
+
readonly normalized: number;
|
|
909
|
+
readonly possibleGap: number;
|
|
910
|
+
readonly unassessed: number;
|
|
911
|
+
readonly recognized: number;
|
|
912
|
+
readonly unresolved: number;
|
|
913
|
+
readonly excludedWithReason: number;
|
|
914
|
+
readonly limited: number;
|
|
915
|
+
}
|
|
916
|
+
|
|
917
|
+
function fmtCounts(counts: CandidateCounts): string {
|
|
918
|
+
return `observed=${counts.observed} normalized=${counts.normalized} ` +
|
|
919
|
+
`possibleGap=${counts.possibleGap} unassessed=${counts.unassessed} ` +
|
|
920
|
+
`recognized=${counts.recognized} unresolved=${counts.unresolved} ` +
|
|
921
|
+
`excludedWithReason=${counts.excludedWithReason} limited=${counts.limited}`;
|
|
922
|
+
}
|
|
923
|
+
|
|
924
|
+
/** `component` facts prefer their own qualifiedName as `Symbol` (mirrors
|
|
925
|
+
* `areaSourceIdentity`); every other kind reuses the generic Control/Action/
|
|
926
|
+
* Effect resolver tiers via the fact's own id as a one-element ref list. */
|
|
927
|
+
function normalizedFactIdentity(fact: SourceFact, idx: SourceFactsIndex): SourceIdentity {
|
|
928
|
+
if (fact.kind === "component") {
|
|
929
|
+
const component = fact as SourceFact<"component">;
|
|
930
|
+
return { symbol: component.data.qualifiedName, evidence: preferredEvidence(component, idx) };
|
|
931
|
+
}
|
|
932
|
+
return resolveSourceIdentity([fact.id], idx);
|
|
933
|
+
}
|
|
934
|
+
|
|
935
|
+
/** One resolved `normalizedFactRefs` entry: the real SourceFact this gap-audit
|
|
936
|
+
* candidate turned into, in the same `Symbol {kind} @Anchor` shape used
|
|
937
|
+
* everywhere else — this is what makes `normalizedFactRefs` informative
|
|
938
|
+
* instead of an opaque `fact:hash` id (its `kind` is always one of the
|
|
939
|
+
* candidate's own `expectedFactKinds` by construction, see buildCategory in
|
|
940
|
+
* analysis/gap-audit/build.ts, so `expectedFactKinds` would be redundant here).
|
|
941
|
+
* Nested directly under the candidate line with no header label — its own
|
|
942
|
+
* `<fact:id>` tag already says what it is, same convention as Area's Controls
|
|
943
|
+
* or Control's Actions. */
|
|
944
|
+
function dumpNormalizedFact(
|
|
945
|
+
ref: string,
|
|
946
|
+
idx: SourceFactsIndex,
|
|
947
|
+
depth: number,
|
|
948
|
+
collisions: ReadonlySet<string>
|
|
949
|
+
): string {
|
|
950
|
+
const fact = idx.factsById.get(ref);
|
|
951
|
+
if (!fact) return `\n${pad(depth)}<${shortId(ref)}>`;
|
|
952
|
+
const identity = normalizedFactIdentity(fact, idx);
|
|
953
|
+
return `\n${pad(depth)}<${shortId(fact.id)}> ${fmtSymbolPrefix(identity)}` +
|
|
954
|
+
`{${fact.kind}}${fmtAnchor(identity.evidence, collisions)}`;
|
|
955
|
+
}
|
|
956
|
+
|
|
957
|
+
/** Free-text `reason`/`unassessedReason` are deliberately not rendered here:
|
|
958
|
+
* `status` (in the header tags) is the "kind of gap", and what each kind
|
|
959
|
+
* means/why is documented once in docs/dump-format.md §5.2 instead of being
|
|
960
|
+
* repeated as near-identical boilerplate prose across thousands of candidate
|
|
961
|
+
* lines (most `reason` strings are one of a handful of fixed templates from
|
|
962
|
+
* analysis/gap-audit/build.ts, not per-candidate information). The full text
|
|
963
|
+
* is still in gap-audit.json for anyone who needs the exact wording. */
|
|
964
|
+
function dumpGapAuditCandidate(
|
|
965
|
+
candidate: GapAuditCandidate,
|
|
966
|
+
depth: number,
|
|
967
|
+
collisions: ReadonlySet<string>,
|
|
968
|
+
sourceFacts: SourceFactsIndex | undefined
|
|
969
|
+
): string {
|
|
970
|
+
const tags = [
|
|
971
|
+
candidate.source,
|
|
972
|
+
candidate.status,
|
|
973
|
+
candidate.critical ? "critical" : undefined
|
|
974
|
+
].filter((tag): tag is string => tag !== undefined);
|
|
975
|
+
const symbol = candidate.evidence?.symbol;
|
|
976
|
+
const rawRecord = candidate.rawRecordRef
|
|
977
|
+
? ` (rawRecord=<${shortId(candidate.rawRecordRef)}>)`
|
|
978
|
+
: "";
|
|
979
|
+
let out = `\n${pad(depth)}<${shortId(candidate.id)}>${symbol ? ` ${symbol}` : ""} ` +
|
|
980
|
+
`{${tags.join(", ")}} "${candidate.semanticKey}"${fmtAnchor(candidate.evidence, collisions)}${rawRecord}`;
|
|
981
|
+
|
|
982
|
+
const resolved = sourceFacts !== undefined && candidate.normalizedFactRefs.length > 0;
|
|
983
|
+
if (resolved) {
|
|
984
|
+
for (const ref of candidate.normalizedFactRefs) {
|
|
985
|
+
out += dumpNormalizedFact(ref, sourceFacts, depth + 1, collisions);
|
|
986
|
+
}
|
|
987
|
+
} else {
|
|
988
|
+
// No resolved fact to show its own {kind} — expectedFactKinds is the
|
|
989
|
+
// only kind information available, gap or not.
|
|
990
|
+
out += fmtList("expectedFactKinds", candidate.expectedFactKinds, depth + 1);
|
|
991
|
+
out += fmtRefList("normalizedFactRefs", candidate.normalizedFactRefs, depth + 1);
|
|
992
|
+
}
|
|
993
|
+
return out;
|
|
994
|
+
}
|
|
995
|
+
|
|
996
|
+
/** `recognized` candidates aren't gaps — they already matched a real fact
|
|
997
|
+
* (see `normalizedFacts:`) — so they sink to the bottom of each category,
|
|
998
|
+
* keeping the statuses worth a reviewer's attention (unresolved, excluded-
|
|
999
|
+
* with-reason, limited) at the top. Stable within each group: ties keep
|
|
1000
|
+
* `category.candidates`' own id order (see buildCategory's final `.sort`). */
|
|
1001
|
+
function sortCandidatesForDump(
|
|
1002
|
+
candidates: readonly GapAuditCandidate[]
|
|
1003
|
+
): readonly GapAuditCandidate[] {
|
|
1004
|
+
return candidates
|
|
1005
|
+
.map((candidate, index) => ({ candidate, index }))
|
|
1006
|
+
.sort((left, right) => {
|
|
1007
|
+
const leftRecognized = left.candidate.status === "recognized" ? 1 : 0;
|
|
1008
|
+
const rightRecognized = right.candidate.status === "recognized" ? 1 : 0;
|
|
1009
|
+
return leftRecognized - rightRecognized || left.index - right.index;
|
|
1010
|
+
})
|
|
1011
|
+
.map((entry) => entry.candidate);
|
|
1012
|
+
}
|
|
1013
|
+
|
|
1014
|
+
function dumpGapAuditCategory(
|
|
1015
|
+
category: GapAuditCategory,
|
|
1016
|
+
depth: number,
|
|
1017
|
+
collisions: ReadonlySet<string>,
|
|
1018
|
+
sourceFacts: SourceFactsIndex | undefined
|
|
1019
|
+
): string {
|
|
1020
|
+
let out = `${pad(depth)}<category:${category.id}> {${category.assessment}} ` +
|
|
1021
|
+
`"${category.label}" (${fmtCounts(category)})`;
|
|
1022
|
+
out += fmtList("expectedFactKinds", category.expectedFactKinds, depth + 1);
|
|
1023
|
+
if (category.unassessedReason) {
|
|
1024
|
+
out += `\n${pad(depth + 1)}unassessedReason: ${category.unassessedReason}`;
|
|
1025
|
+
}
|
|
1026
|
+
for (const candidate of sortCandidatesForDump(category.candidates)) {
|
|
1027
|
+
out += dumpGapAuditCandidate(candidate, depth + 1, collisions, sourceFacts);
|
|
1028
|
+
}
|
|
1029
|
+
return out;
|
|
1030
|
+
}
|
|
1031
|
+
|
|
1032
|
+
function dumpSemanticLimitation(limitation: SemanticLimitation, depth: number): string {
|
|
1033
|
+
const tags = [limitation.code, limitation.critical ? "critical" : undefined]
|
|
1034
|
+
.filter((tag): tag is string => tag !== undefined);
|
|
1035
|
+
let out = `${pad(depth)}<${shortId(limitation.id)}> {${tags.join(", ")}} ${limitation.message}`;
|
|
1036
|
+
out += fmtRefList("candidates", limitation.candidateRefs, depth + 1);
|
|
1037
|
+
out += fmtRefList("support", limitation.supportRefs, depth + 1);
|
|
1038
|
+
return out;
|
|
1039
|
+
}
|
|
1040
|
+
|
|
1041
|
+
/**
|
|
1042
|
+
* Dumps a GapAuditArtifact as an indented tree instead of JSON. Passing the
|
|
1043
|
+
* matching source-facts.json (same run) additionally resolves each
|
|
1044
|
+
* candidate's `normalizedFactRefs` into their real Symbol/{kind}/@Anchor
|
|
1045
|
+
* identity (dropping the now-redundant `expectedFactKinds` for those
|
|
1046
|
+
* candidates — see `dumpNormalizedFact`); omitted, dump renders exactly as
|
|
1047
|
+
* before, with bare `normalizedFactRefs: [<id>, ...]`.
|
|
1048
|
+
*/
|
|
1049
|
+
export function dumpGapAudit(audit: GapAuditArtifact, sourceFactsArtifact?: SourceFactsArtifact): string {
|
|
1050
|
+
const sourceFacts = buildSourceFactsIndex(sourceFactsArtifact);
|
|
1051
|
+
const lines: string[] = [];
|
|
1052
|
+
lines.push(
|
|
1053
|
+
audit.target
|
|
1054
|
+
? `GapAudit <${audit.caseId}> [${audit.target.applicationModule}:${audit.target.buildVariant}]`
|
|
1055
|
+
: `GapAudit <${audit.caseId}>`
|
|
1056
|
+
);
|
|
1057
|
+
lines.push(
|
|
1058
|
+
`Availability: utg=${audit.sourceAvailability.utg} ` +
|
|
1059
|
+
`tree-sitter=${audit.sourceAvailability.treeSitter} ` +
|
|
1060
|
+
`homegraph=${audit.sourceAvailability.homeGraph} ` +
|
|
1061
|
+
`agent-shards=${audit.sourceAvailability.agentShards} ` +
|
|
1062
|
+
`source-facts=${audit.sourceAvailability.sourceFacts}`
|
|
1063
|
+
);
|
|
1064
|
+
lines.push(`Completeness: {${audit.semanticCompleteness}}`);
|
|
1065
|
+
lines.push(`Summary: ${fmtCounts(audit.summary)}`);
|
|
1066
|
+
|
|
1067
|
+
const allCandidates = audit.categories.flatMap((category) => category.candidates);
|
|
1068
|
+
const candidateEvidencePaths = allCandidates.flatMap(
|
|
1069
|
+
(candidate) => candidate.evidence ? [candidate.evidence.path] : []
|
|
1070
|
+
);
|
|
1071
|
+
// Same collision universe also covers resolved normalizedFacts' own
|
|
1072
|
+
// anchors, so a shortened candidate anchor and its resolved fact's anchor
|
|
1073
|
+
// never disagree on whether a given basename needed the full path.
|
|
1074
|
+
const normalizedFactPaths = sourceFacts === undefined
|
|
1075
|
+
? []
|
|
1076
|
+
: allCandidates
|
|
1077
|
+
.flatMap((candidate) => candidate.normalizedFactRefs)
|
|
1078
|
+
.flatMap((ref) => {
|
|
1079
|
+
const fact = sourceFacts.factsById.get(ref);
|
|
1080
|
+
const evidence = fact ? normalizedFactIdentity(fact, sourceFacts).evidence : undefined;
|
|
1081
|
+
return evidence ? [evidence.path] : [];
|
|
1082
|
+
});
|
|
1083
|
+
const collisions = collidingBasenames([...candidateEvidencePaths, ...normalizedFactPaths]);
|
|
1084
|
+
|
|
1085
|
+
lines.push("Categories:");
|
|
1086
|
+
for (const category of audit.categories) {
|
|
1087
|
+
lines.push(dumpGapAuditCategory(category, 1, collisions, sourceFacts));
|
|
1088
|
+
}
|
|
1089
|
+
|
|
1090
|
+
if (audit.semanticLimitations.length === 0) {
|
|
1091
|
+
lines.push("Semantic Limitations: none");
|
|
1092
|
+
} else {
|
|
1093
|
+
lines.push(`Semantic Limitations (${audit.semanticLimitations.length}):`);
|
|
1094
|
+
for (const limitation of audit.semanticLimitations) {
|
|
1095
|
+
lines.push(dumpSemanticLimitation(limitation, 1));
|
|
1096
|
+
}
|
|
1097
|
+
}
|
|
1098
|
+
|
|
1099
|
+
if (audit.limitations.length === 0) {
|
|
1100
|
+
lines.push("Limitations: none");
|
|
1101
|
+
} else {
|
|
1102
|
+
lines.push("Limitations:");
|
|
1103
|
+
for (const text of audit.limitations) lines.push(`${pad(1)}- ${text}`);
|
|
1104
|
+
}
|
|
1105
|
+
|
|
1106
|
+
return lines.join("\n");
|
|
1107
|
+
}
|
|
1108
|
+
|
|
1109
|
+
// ---------------------------------------------------------------------------
|
|
1110
|
+
// Diagnostics
|
|
1111
|
+
// ---------------------------------------------------------------------------
|
|
1112
|
+
|
|
1113
|
+
/** `details` string values are near-always cross-reference ids (unresolvedRef,
|
|
1114
|
+
* evidenceRefs, candidateRefs, ...) — run them through `shortId` like every
|
|
1115
|
+
* other id in this dump instead of printing the full `tag:caseId/subkind/hash`
|
|
1116
|
+
* (harmless no-op on the rare plain-text/non-id string, since `shortId`
|
|
1117
|
+
* already passes those through unchanged). Arrays render `[a, b]` (matching
|
|
1118
|
+
* `fmtRefList`'s bracket style) instead of a quoted JSON array. */
|
|
1119
|
+
function fmtDetailValue(value: JsonValue): string {
|
|
1120
|
+
if (typeof value === "string") return shortId(value);
|
|
1121
|
+
if (Array.isArray(value)) return `[${value.map(fmtDetailValue).join(", ")}]`;
|
|
1122
|
+
return JSON.stringify(value);
|
|
1123
|
+
}
|
|
1124
|
+
|
|
1125
|
+
/** `details.impact` (present on diagnostics derived from an UnresolvedItem)
|
|
1126
|
+
* promoted to its own line — it is the concrete "what breaks downstream"
|
|
1127
|
+
* answer, the single most debugging-relevant field `details` ever carries,
|
|
1128
|
+
* so it does not belong lumped into the generic key=value dump below. */
|
|
1129
|
+
function detailImpact(details: Diagnostic["details"]): readonly string[] {
|
|
1130
|
+
const impact = details?.impact;
|
|
1131
|
+
return Array.isArray(impact) && impact.every((item) => typeof item === "string")
|
|
1132
|
+
? impact as readonly string[]
|
|
1133
|
+
: [];
|
|
1134
|
+
}
|
|
1135
|
+
|
|
1136
|
+
/** Every remaining `details` key (impact excluded, already its own line) as
|
|
1137
|
+
* one key=value line — shape varies by diagnostic origin (budget numbers,
|
|
1138
|
+
* gap-audit candidateRefs, unresolved's evidenceRefs, ...), genuinely
|
|
1139
|
+
* per-instance debugging payload, unlike `remediation`/`disposition` (see
|
|
1140
|
+
* `dumpDiagnostics`'s own doc comment for why those are omitted instead). */
|
|
1141
|
+
function fmtDetails(details: Diagnostic["details"], depth: number): string {
|
|
1142
|
+
if (!details) return "";
|
|
1143
|
+
const entries = Object.entries(details).filter(([key]) => key !== "impact");
|
|
1144
|
+
if (entries.length === 0) return "";
|
|
1145
|
+
const line = entries.map(([key, value]) => `${key}=${fmtDetailValue(value)}`).join(" ");
|
|
1146
|
+
return `\n${pad(depth)}details: ${line}`;
|
|
1147
|
+
}
|
|
1148
|
+
|
|
1149
|
+
function dumpDiagnostic(diagnostic: Diagnostic, collisions: ReadonlySet<string>): string {
|
|
1150
|
+
const tags = [diagnostic.stage, diagnostic.severity, diagnostic.category].join(", ");
|
|
1151
|
+
const entity = diagnostic.entityKey ? ` (entity=<${shortId(diagnostic.entityKey)}>)` : "";
|
|
1152
|
+
let out = `${pad(1)}<${shortId(diagnostic.id)}> {${tags}} ${diagnostic.code}: ${diagnostic.message}` +
|
|
1153
|
+
`${fmtAnchor(diagnostic.location, collisions)}${entity}`;
|
|
1154
|
+
out += fmtList("impact", detailImpact(diagnostic.details), 2);
|
|
1155
|
+
out += fmtDetails(diagnostic.details, 2);
|
|
1156
|
+
return out;
|
|
1157
|
+
}
|
|
1158
|
+
|
|
1159
|
+
/**
|
|
1160
|
+
* Dumps a flat `Diagnostic[]` (diagnostics.json) as one line per diagnostic
|
|
1161
|
+
* instead of a raw JSON array. Distinct from `dumpGapAudit`: gap-audit is a
|
|
1162
|
+
* full structural census — every source candidate the analyzer looked at,
|
|
1163
|
+
* recognized or not, organized by category (docs/dump-format.md §5) —
|
|
1164
|
+
* while diagnostics.json is the flat, error-oriented run log actually meant
|
|
1165
|
+
* to be read top to bottom. Some entries are *derived from* gap-audit's own
|
|
1166
|
+
* unresolved-critical candidates (`diagnosticsForGapAudit`) or from
|
|
1167
|
+
* `graph.unresolved`; the rest (budget/infrastructure failures) never
|
|
1168
|
+
* appear in gap-audit at all. Two JSON fields are deliberately not rendered
|
|
1169
|
+
* (see docs/dump-format.md §6): `remediation` (fixed boilerplate text per
|
|
1170
|
+
* `code`, not per-instance information — same reasoning as gap-audit's own
|
|
1171
|
+
* `reason`/`unassessedReason`) and `disposition` (100% derivable from
|
|
1172
|
+
* `severity`: "error" only ever occurs on a `fail-run` diagnostic,
|
|
1173
|
+
* "info"/"warning" only on "continue" — see FailingDiagnostic/
|
|
1174
|
+
* ContinuingDiagnostic in contracts/diagnostic.ts).
|
|
1175
|
+
*/
|
|
1176
|
+
export function dumpDiagnostics(diagnostics: readonly Diagnostic[]): string {
|
|
1177
|
+
if (diagnostics.length === 0) return "Diagnostics: none";
|
|
1178
|
+
const collisions = collidingBasenames(
|
|
1179
|
+
diagnostics.flatMap((diagnostic) => diagnostic.location ? [diagnostic.location.path] : [])
|
|
1180
|
+
);
|
|
1181
|
+
const lines = [`Diagnostics (${diagnostics.length}):`];
|
|
1182
|
+
for (const diagnostic of diagnostics) lines.push(dumpDiagnostic(diagnostic, collisions));
|
|
1183
|
+
return lines.join("\n");
|
|
1184
|
+
}
|