@buaa_smat/hometrans 26.0.5 → 26.0.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +249 -279
- package/agents/code-reviewer.md +1 -1
- package/dist/cli/editors.json +20 -0
- package/dist/platform/registry.js +1 -0
- package/dist/platform/validate.js +2 -1
- package/i18n/agents/code-reviewer.md +1 -1
- package/i18n/platforms/atomcode/skills/a2h-app-migrate/SKILL.unique.md +3 -0
- package/i18n/platforms/claude-code/skills/a2h-app-migrate/SKILL.unique.md +3 -0
- package/i18n/platforms/codebuddy/skills/a2h-app-migrate/SKILL.unique.md +8 -0
- package/i18n/platforms/codex/skills/a2h-app-migrate/SKILL.unique.md +3 -0
- package/i18n/platforms/cursor/skills/a2h-app-migrate/SKILL.unique.md +3 -0
- package/i18n/platforms/deveco/skills/a2h-app-migrate/SKILL.unique.md +3 -0
- package/i18n/platforms/opencode/skills/a2h-app-migrate/SKILL.unique.md +10 -0
- package/i18n/platforms/qoder/skills/a2h-app-migrate/SKILL.unique.md +3 -0
- package/i18n/platforms/qoder-cn/skills/a2h-app-migrate/SKILL.unique.md +8 -0
- package/i18n/platforms/trae/skills/a2h-app-migrate/SKILL.unique.md +3 -0
- package/i18n/platforms/trae-cn/skills/a2h-app-migrate/SKILL.unique.md +3 -0
- package/i18n/skills/a2h-app-migrate/SKILL.md +32 -15
- package/i18n/skills/a2h-app-migrate/references/stage-map.md +4 -2
- package/i18n/skills/a2h-app-migrate/references/workflow.yaml +148 -89
- package/i18n/skills/a2h-app-migrate/scripts/env_preflight.mjs +1 -1
- package/i18n/skills/a2h-app-migrate/scripts/validate_workflow.mjs +51 -2
- package/i18n/skills/a2h-app-migrate/test/test_build_fixer_contract.mjs +1 -1
- package/i18n/skills/a2h-app-migrate/test/test_interaction.mjs +0 -2
- package/i18n/skills/a2h-app-migrate/test/test_resume_plan.mjs +1 -1
- package/i18n/skills/a2h-app-migrate/test/test_skill_doc.mjs +1 -1
- package/i18n/skills/a2h-app-migrate/test/test_specs_json_preflight.mjs +1 -1
- package/i18n/skills/a2h-app-migrate/test/test_utg_static_done.mjs +9 -3
- package/i18n/skills/a2h-app-migrate/test/test_validate_workflow_bilingual.mjs +4 -2
- package/i18n/skills/a2h-arkts-logic-coder/SKILL.md +8 -7
- package/i18n/skills/a2h-arkts-logic-coder/references/ISSUES.md +2 -2
- package/i18n/skills/a2h-arkts-logic-coder/references/code-generation.md +33 -12
- package/i18n/skills/a2h-batch-ui-align/SKILL.md +14 -12
- package/i18n/skills/a2h-batch-ui-align/references/cards/alignment.md +1 -0
- package/i18n/skills/a2h-batch-ui-align/references/cards/canvas.md +1 -0
- package/i18n/skills/a2h-batch-ui-align/references/cards/dynamics.md +32 -1
- package/i18n/skills/a2h-batch-ui-align/references/cards/geometry.md +3 -2
- package/i18n/skills/a2h-batch-ui-align/references/cards/interaction.md +4 -0
- package/i18n/skills/a2h-batch-ui-align/references/cards/resources.md +19 -1
- package/i18n/skills/a2h-batch-ui-align/references/cards/widgets.md +13 -1
- package/i18n/skills/a2h-batch-ui-align/references/cards/window.md +2 -2
- package/i18n/skills/a2h-batch-ui-align/references/checker-rules.md +205 -7
- package/i18n/skills/a2h-batch-ui-align/references/conversion-procedure.md +10 -17
- package/i18n/skills/a2h-batch-ui-align/references/incremental-scope.md +3 -4
- package/i18n/skills/a2h-batch-ui-align/references/lottie-integration.md +47 -2
- package/i18n/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-atomic-component-mapping-reference.md +52 -328
- package/i18n/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-interaction-mapping-reference.md +1 -138
- package/i18n/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-layout-mapping-reference.md +2 -11
- package/i18n/skills/a2h-batch-ui-align/references/state-mgmt/_paradigm-selection.md +1 -1
- package/i18n/skills/a2h-batch-ui-align/references/step3-capture.md +8 -23
- package/i18n/skills/a2h-batch-ui-align/references/step4-prepare.md +2 -1
- package/i18n/skills/a2h-batch-ui-align/references/step5-convert.md +17 -9
- package/i18n/skills/a2h-batch-ui-align/scripts/build_conversion_set.mjs +239 -16
- package/i18n/skills/a2h-batch-ui-align/scripts/group_pack.mjs +6 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/icon_coverage.mjs +6 -3
- package/i18n/skills/a2h-batch-ui-align/scripts/measure_pack.ts +170 -10
- package/i18n/skills/a2h-batch-ui-align/scripts/phase5_check.mjs +42 -1
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/main.ts +20 -1
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/attr_chain.ts +81 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/click_handler.ts +140 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/collapsing_toolbar.ts +124 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/compose_semantics.ts +287 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/flowitem_width.ts +78 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/hit_test.ts +194 -8
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/inset_stacked.ts +138 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/int_division.ts +181 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/layout_placement.ts +62 -2
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/lottie_path.ts +77 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/lottie_ready.ts +109 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/media_tint.ts +88 -18
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/relative_container_cycle.ts +140 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/relative_container_height.ts +2 -2
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/see_through_overlay.ts +149 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/sheet_builder.ts +139 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/sheet_show_close.ts +53 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/space_between_optional.ts +115 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/theme_color.ts +7 -1
- package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/width_fill.ts +160 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_inset_stacked.test.mjs +155 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_layout_placement.test.mjs +60 -0
- package/i18n/skills/a2h-batch-ui-align/scripts/tests/build_conversion_set.test.mjs +38 -0
- package/i18n/skills/a2h-module-semantic-docs/SKILL.md +3 -2
- package/i18n/skills/a2h-page-specgen/SKILL.md +36 -5
- package/i18n/skills/a2h-page-specgen/references/behavior-ledger.md +89 -21
- package/i18n/skills/a2h-page-specgen/references/gates.md +33 -7
- package/i18n/skills/a2h-page-specgen/references/scenario-authoring.md +67 -13
- package/i18n/skills/a2h-page-specgen/references/spec-example.md +166 -32
- package/i18n/skills/a2h-page-specgen/references/spec-template.md +8 -5
- package/i18n/skills/a2h-page-specgen/scripts/behavior-audit.mjs +37 -1
- package/i18n/skills/a2h-page-specgen/scripts/behavior-discovery.mjs +241 -22
- package/i18n/skills/a2h-page-specgen/scripts/behavior-model.mjs +29 -2
- package/i18n/skills/a2h-page-specgen/scripts/behavior-reconcile.mjs +32 -0
- package/i18n/skills/a2h-page-specgen/scripts/contract-calls.mjs +715 -0
- package/i18n/skills/a2h-page-specgen/scripts/footprint.mjs +129 -2
- package/i18n/skills/a2h-page-specgen/scripts/gate.mjs +19 -10
- package/i18n/skills/a2h-page-specgen/scripts/lib/contracts.mjs +62 -3
- package/i18n/skills/a2h-page-specgen/scripts/lib/graph-evidence.mjs +27 -0
- package/i18n/skills/a2h-page-specgen/scripts/lib/hg.mjs +116 -6
- package/i18n/skills/a2h-page-specgen/scripts/operation-evidence.mjs +270 -29
- package/i18n/skills/a2h-page-specgen/scripts/prepare.mjs +26 -14
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.prompt.md +118 -25
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.worker.md +104 -19
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.prompt.md +118 -25
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.worker.md +104 -19
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.discovery.json +216 -216
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.json +1 -1
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.post-review.json +2 -2
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.prompt.md +118 -25
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.worker.md +100 -15
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.prompt.md +118 -25
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.worker.md +104 -19
- package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/run.mjs +155 -3
- package/i18n/skills/a2h-page-specgen/scripts/test/android-operation-evidence.test.mjs +529 -1
- package/i18n/skills/a2h-page-specgen/scripts/test/behavior-audit-pre.test.mjs +27 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/behavior-discovery.test.mjs +158 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/behavior-fixtures.mjs +11 -13
- package/i18n/skills/a2h-page-specgen/scripts/test/behavior-reconcile.test.mjs +97 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/contract-calls.test.mjs +737 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/contracts.test.mjs +75 -3
- package/i18n/skills/a2h-page-specgen/scripts/test/finalize.test.mjs +24 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/hg.mkdb.mjs +124 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/footprint-resolve.test.mjs +6 -2
- package/i18n/skills/a2h-page-specgen/scripts/test/gate.test.mjs +106 -1
- package/i18n/skills/a2h-page-specgen/scripts/test/graph-evidence.test.mjs +32 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/hg.test.mjs +12 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/operation-reviews.test.mjs +6 -1
- package/i18n/skills/a2h-page-specgen/scripts/test/prompt-tpl.test.mjs +11 -3
- package/i18n/skills/a2h-page-specgen/scripts/test/protocol-docs.test.mjs +1 -1
- package/i18n/skills/a2h-page-specgen/scripts/test/recovery-e2e.test.mjs +1 -0
- package/i18n/skills/a2h-page-specgen/scripts/test/submit.test.mjs +159 -27
- package/i18n/skills/a2h-resource-convert/SKILL.md +1 -1
- package/i18n/skills/a2h-resource-convert/references/lottie-conversion-rules.md +2 -2
- package/i18n/skills/a2h-resource-convert/scripts/a2h_resource_convert.ts +124 -8
- package/i18n/skills/a2h-resource-convert/scripts/sync-framework-strings.mjs +147 -0
- package/i18n/skills/a2h-resource-convert/scripts/tests/framework_strings.test.mjs +131 -0
- package/i18n/skills/a2h-spec-design-pipeline/SKILL.md +15 -12
- package/i18n/skills/a2h-spec-design-pipeline/references/coding-loop.md +38 -10
- package/i18n/skills/a2h-spec-design-pipeline/references/initialization.md +2 -2
- package/i18n/skills/a2h-spec-design-pipeline/references/post-loop.md +2 -2
- package/i18n/skills/a2h-spec-design-pipeline/references/reply-recovery.md +172 -0
- package/i18n/skills/a2h-spec-design-pipeline/references/review-loop.md +2 -2
- package/i18n/skills/a2h-spec-design-pipeline/references/scripts.md +5 -3
- package/i18n/skills/a2h-spec-design-pipeline/references/state-and-resume.md +7 -1
- package/i18n/skills/a2h-spec-design-pipeline/scripts/plan_groups.ts +1 -1
- package/i18n/skills/a2h-spec-design-pipeline/scripts/test_plan_groups.ts +2 -0
- package/i18n/skills/a2h-spec-generate/references/input-formats.md +1 -1
- package/i18n/skills/a2h-utg-explorer/SKILL.md +11 -5
- package/i18n/skills/a2h-utg-explorer/references/architecture.md +37 -19
- package/i18n/skills/a2h-utg-explorer/scripts/compile_tasks.mjs +48 -3
- package/i18n/skills/a2h-utg-explorer/scripts/final_utg.mjs +21 -0
- package/i18n/skills/a2h-utg-explorer/scripts/recover_d.mjs +67 -8
- package/i18n/skills/a2h-utg-explorer/scripts/tests/diagnostics.test.mjs +32 -0
- package/i18n/skills/a2h-utg-explorer/scripts/tests/dialog_own_layout.test.mjs +40 -0
- package/i18n/skills/a2h-utg-explorer/scripts/utg_explorer/semantics.mjs +63 -2
- package/i18n/skills/a2h-utg-explorer/scripts/utg_explorer/task_runner.mjs +143 -14
- package/i18n/skills/a2h-utg-static/SKILL.md +3 -3
- package/i18n/skills/a2h-utg-static/references/ui-elements-static-utg-schema.md +4 -3
- package/i18n/skills/a2h-utg-static/scripts/click_paths.mjs +1 -1
- package/i18n/skills/a2h-utg-static/scripts/tests/test_compose_res_text.mjs +25 -0
- package/i18n/skills/a2h-utg-static/tools/convert_static_utg_to_ui_elements.ts +1 -0
- package/package.json +2 -1
- package/platforms/atomcode/skills/a2h-app-migrate/SKILL.unique.md +3 -0
- package/platforms/claude-code/skills/a2h-app-migrate/SKILL.unique.md +3 -0
- package/platforms/codebuddy/agents/build-fixer.frontmatter.md +5 -0
- package/platforms/codebuddy/agents/code-reviewer.frontmatter.md +5 -0
- package/platforms/codebuddy/agents/model-render-worker.frontmatter.md +5 -0
- package/platforms/codebuddy/agents/model-worker.frontmatter.md +5 -0
- package/platforms/codebuddy/agents/specgen-worker.frontmatter.md +5 -0
- package/platforms/codebuddy/skills/a2h-app-migrate/SKILL.unique.md +8 -0
- package/platforms/codex/skills/a2h-app-migrate/SKILL.unique.md +3 -0
- package/platforms/cursor/skills/a2h-app-migrate/SKILL.unique.md +3 -0
- package/platforms/deveco/agents/build-fixer.frontmatter.md +2 -0
- package/platforms/deveco/agents/code-reviewer.frontmatter.md +2 -0
- package/platforms/deveco/agents/model-render-worker.frontmatter.md +2 -0
- package/platforms/deveco/agents/model-worker.frontmatter.md +2 -0
- package/platforms/deveco/agents/specgen-worker.frontmatter.md +2 -0
- package/platforms/deveco/skills/a2h-app-migrate/SKILL.unique.md +3 -0
- package/platforms/opencode/agents/build-fixer.frontmatter.md +2 -0
- package/platforms/opencode/agents/code-reviewer.frontmatter.md +2 -0
- package/platforms/opencode/agents/model-render-worker.frontmatter.md +2 -0
- package/platforms/opencode/agents/model-worker.frontmatter.md +2 -0
- package/platforms/opencode/agents/specgen-worker.frontmatter.md +2 -0
- package/platforms/opencode/skills/a2h-app-migrate/SKILL.unique.md +10 -0
- package/platforms/qoder/skills/a2h-app-migrate/SKILL.unique.md +3 -0
- package/platforms/qoder-cn/skills/a2h-app-migrate/SKILL.unique.md +8 -0
- package/platforms/trae/skills/a2h-app-migrate/SKILL.unique.md +3 -0
- package/platforms/trae-cn/skills/a2h-app-migrate/SKILL.unique.md +3 -0
- package/skills/a2h-app-migrate/SKILL.md +31 -14
- package/skills/a2h-app-migrate/references/stage-map.md +4 -2
- package/skills/a2h-app-migrate/references/workflow.yaml +152 -89
- package/skills/a2h-app-migrate/scripts/assert_dag_complete.mjs +1 -1
- package/skills/a2h-app-migrate/scripts/check_ui_batch_done.mjs +28 -11
- package/skills/a2h-app-migrate/scripts/dag_action_catalog.mjs +76 -0
- package/skills/a2h-app-migrate/scripts/dag_production_executor.mjs +60 -5
- package/skills/a2h-app-migrate/scripts/dag_runner.mjs +184 -4
- package/skills/a2h-app-migrate/scripts/env_preflight.mjs +1 -1
- package/skills/a2h-app-migrate/scripts/ledger.mjs +2 -2
- package/skills/a2h-app-migrate/scripts/resume_plan.mjs +3 -3
- package/skills/a2h-app-migrate/scripts/validate_workflow.mjs +51 -2
- package/skills/a2h-app-migrate/test/test_dag_blocked_guard.mjs +291 -0
- package/skills/a2h-app-migrate/test/test_dag_production.mjs +40 -0
- package/skills/a2h-app-migrate/test/test_dag_runner.mjs +4 -3
- package/skills/a2h-app-migrate/test/test_i18n_engine_mirror.mjs +1 -1
- package/skills/a2h-app-migrate/test/test_interaction.mjs +0 -2
- package/skills/a2h-app-migrate/test/test_resume_plan.mjs +1 -1
- package/skills/a2h-app-migrate/test/test_skill_doc.mjs +1 -1
- package/skills/a2h-app-migrate/test/test_spec_engine_contract.mjs +1 -1
- package/skills/a2h-app-migrate/test/test_specs_json_preflight.mjs +1 -1
- package/skills/a2h-app-migrate/test/test_ui_batch_done.mjs +36 -0
- package/skills/a2h-app-migrate/test/test_utg_static_done.mjs +19 -6
- package/skills/a2h-app-migrate/test/test_validate_workflow_bilingual.mjs +4 -2
- package/skills/a2h-arkts-logic-coder/SKILL.md +8 -7
- package/skills/a2h-arkts-logic-coder/references/ISSUES.md +2 -2
- package/skills/a2h-arkts-logic-coder/references/code-generation.md +33 -12
- package/skills/a2h-batch-ui-align/SKILL.md +14 -12
- package/skills/a2h-batch-ui-align/references/cards/alignment.md +1 -0
- package/skills/a2h-batch-ui-align/references/cards/canvas.md +1 -0
- package/skills/a2h-batch-ui-align/references/cards/dynamics.md +32 -1
- package/skills/a2h-batch-ui-align/references/cards/geometry.md +3 -2
- package/skills/a2h-batch-ui-align/references/cards/interaction.md +4 -0
- package/skills/a2h-batch-ui-align/references/cards/resources.md +19 -1
- package/skills/a2h-batch-ui-align/references/cards/widgets.md +13 -1
- package/skills/a2h-batch-ui-align/references/cards/window.md +2 -2
- package/skills/a2h-batch-ui-align/references/checker-rules.md +205 -7
- package/skills/a2h-batch-ui-align/references/conversion-procedure.md +10 -17
- package/skills/a2h-batch-ui-align/references/incremental-scope.md +3 -4
- package/skills/a2h-batch-ui-align/references/lottie-integration.md +47 -2
- package/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-atomic-component-mapping-reference.md +52 -328
- package/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-interaction-mapping-reference.md +1 -138
- package/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-layout-mapping-reference.md +2 -11
- package/skills/a2h-batch-ui-align/references/state-mgmt/_/350/214/203/345/274/217/351/200/211/346/213/251/350/257/264/346/230/216.md +1 -1
- package/skills/a2h-batch-ui-align/references/step3-capture.md +8 -23
- package/skills/a2h-batch-ui-align/references/step4-prepare.md +2 -1
- package/skills/a2h-batch-ui-align/references/step5-convert.md +17 -9
- package/skills/a2h-batch-ui-align/scripts/build_conversion_set.mjs +239 -16
- package/skills/a2h-batch-ui-align/scripts/group_commit.mjs +6 -1
- package/skills/a2h-batch-ui-align/scripts/group_pack.mjs +6 -0
- package/skills/a2h-batch-ui-align/scripts/group_pass.mjs +270 -0
- package/skills/a2h-batch-ui-align/scripts/group_queue.mjs +134 -16
- package/skills/a2h-batch-ui-align/scripts/group_watch.mjs +39 -8
- package/skills/a2h-batch-ui-align/scripts/icon_coverage.mjs +6 -3
- package/skills/a2h-batch-ui-align/scripts/measure_pack.ts +170 -10
- package/skills/a2h-batch-ui-align/scripts/module_placement.mjs +189 -0
- package/skills/a2h-batch-ui-align/scripts/overlay_effects.mjs +205 -0
- package/skills/a2h-batch-ui-align/scripts/phase5_check.mjs +42 -1
- package/skills/a2h-batch-ui-align/scripts/static_check/main.ts +20 -1
- package/skills/a2h-batch-ui-align/scripts/static_check/registry.ts +28 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/attr_chain.ts +81 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/click_handler.ts +140 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/collapsing_toolbar.ts +124 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/compose_semantics.ts +287 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/flowitem_width.ts +78 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/hit_test.ts +194 -8
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/inset_stacked.ts +138 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/int_division.ts +181 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/layout_placement.ts +62 -2
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/lottie_path.ts +77 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/lottie_ready.ts +109 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/media_tint.ts +88 -18
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/relative_container_cycle.ts +140 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/relative_container_height.ts +2 -2
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/see_through_overlay.ts +149 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/sheet_builder.ts +139 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/sheet_show_close.ts +53 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/space_between_optional.ts +115 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/theme_color.ts +7 -1
- package/skills/a2h-batch-ui-align/scripts/static_check/rules/width_fill.ts +160 -0
- package/skills/a2h-batch-ui-align/scripts/static_check/scan_file.ts +28 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_chrome_defaults.test.mjs +328 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_click_handler.test.mjs +127 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_compose_semantics.test.mjs +150 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_hit_test.test.mjs +117 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_inset_stacked.test.mjs +155 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_layout_placement.test.mjs +60 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_rule_smoke.test.mjs +413 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_runtime_api.test.mjs +159 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_sheet_builder.test.mjs +192 -0
- package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_theme.test.mjs +4 -2
- package/skills/a2h-batch-ui-align/scripts/tests/build_conversion_set.test.mjs +38 -0
- package/skills/a2h-batch-ui-align/scripts/tests/build_conversion_set_compose.test.mjs +106 -0
- package/skills/a2h-batch-ui-align/scripts/tests/group_commit.test.mjs +15 -0
- package/skills/a2h-batch-ui-align/scripts/tests/group_pass.test.mjs +150 -0
- package/skills/a2h-batch-ui-align/scripts/tests/group_queue.test.mjs +125 -0
- package/skills/a2h-batch-ui-align/scripts/tests/group_watch.test.mjs +56 -0
- package/skills/a2h-batch-ui-align/scripts/tests/measure_pack_icon_leaf.test.mjs +143 -0
- package/skills/a2h-batch-ui-align/scripts/tests/module_placement.test.mjs +248 -0
- package/skills/a2h-batch-ui-align/scripts/tests/overlay_effects.test.mjs +214 -0
- package/skills/a2h-fix-build-errors/references/known-patterns.md +5 -5
- package/skills/a2h-module-semantic-docs/SKILL.md +3 -2
- package/skills/a2h-module-semantic-docs/scripts/commit_module_state.mjs +10 -0
- package/skills/a2h-module-semantic-docs/scripts/design_baseline.mjs +158 -0
- package/skills/a2h-module-semantic-docs/test/test_design_baseline.mjs +128 -0
- package/skills/a2h-page-specgen/SKILL.md +36 -5
- package/skills/a2h-page-specgen/references/behavior-ledger.md +88 -21
- package/skills/a2h-page-specgen/references/evidence.md +2 -1
- package/skills/a2h-page-specgen/references/execution-model.md +13 -5
- package/skills/a2h-page-specgen/references/gates.md +33 -7
- package/skills/a2h-page-specgen/references/scenario-authoring.md +67 -13
- package/skills/a2h-page-specgen/references/spec-example.md +166 -32
- package/skills/a2h-page-specgen/references/spec-template.md +8 -5
- package/skills/a2h-page-specgen/scripts/behavior-audit.mjs +40 -2
- package/skills/a2h-page-specgen/scripts/behavior-discovery.mjs +241 -22
- package/skills/a2h-page-specgen/scripts/behavior-model.mjs +29 -2
- package/skills/a2h-page-specgen/scripts/behavior-reconcile.mjs +35 -2
- package/skills/a2h-page-specgen/scripts/contract-calls.mjs +715 -0
- package/skills/a2h-page-specgen/scripts/finalize.mjs +55 -2
- package/skills/a2h-page-specgen/scripts/footprint.mjs +129 -2
- package/skills/a2h-page-specgen/scripts/gate.mjs +20 -11
- package/skills/a2h-page-specgen/scripts/lib/contracts.mjs +56 -3
- package/skills/a2h-page-specgen/scripts/lib/graph-evidence.mjs +27 -0
- package/skills/a2h-page-specgen/scripts/lib/hg.mjs +114 -5
- package/skills/a2h-page-specgen/scripts/lib/ledger.mjs +20 -3
- package/skills/a2h-page-specgen/scripts/operation-evidence.mjs +270 -29
- package/skills/a2h-page-specgen/scripts/prepare.mjs +25 -14
- package/skills/a2h-page-specgen/scripts/report.mjs +26 -5
- package/skills/a2h-page-specgen/scripts/submission.mjs +69 -2
- package/skills/a2h-page-specgen/scripts/submit.mjs +105 -4
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.prompt.md +110 -18
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.worker.md +97 -12
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.prompt.md +110 -18
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.worker.md +97 -12
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.discovery.json +224 -224
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.json +1 -1
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.post-review.json +2 -2
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.prompt.md +110 -18
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.worker.md +97 -12
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.prompt.md +110 -18
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.worker.md +97 -12
- package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/run.mjs +153 -3
- package/skills/a2h-page-specgen/scripts/test/android-operation-evidence.test.mjs +529 -1
- package/skills/a2h-page-specgen/scripts/test/behavior-audit-pre.test.mjs +27 -0
- package/skills/a2h-page-specgen/scripts/test/behavior-discovery.test.mjs +158 -0
- package/skills/a2h-page-specgen/scripts/test/behavior-fixtures.mjs +11 -13
- package/skills/a2h-page-specgen/scripts/test/behavior-reconcile.test.mjs +97 -0
- package/skills/a2h-page-specgen/scripts/test/contract-calls.test.mjs +737 -0
- package/skills/a2h-page-specgen/scripts/test/contracts.test.mjs +82 -3
- package/skills/a2h-page-specgen/scripts/test/finalize.test.mjs +24 -0
- package/skills/a2h-page-specgen/scripts/test/fixtures/hg.mkdb.mjs +11 -0
- package/skills/a2h-page-specgen/scripts/test/footprint-resolve.test.mjs +6 -2
- package/skills/a2h-page-specgen/scripts/test/gate.test.mjs +94 -1
- package/skills/a2h-page-specgen/scripts/test/graph-evidence.test.mjs +32 -0
- package/skills/a2h-page-specgen/scripts/test/hg.test.mjs +14 -0
- package/skills/a2h-page-specgen/scripts/test/ledger.test.mjs +49 -1
- package/skills/a2h-page-specgen/scripts/test/operation-reviews.test.mjs +6 -1
- package/skills/a2h-page-specgen/scripts/test/prompt-tpl.test.mjs +12 -4
- package/skills/a2h-page-specgen/scripts/test/protocol-docs.test.mjs +1 -1
- package/skills/a2h-page-specgen/scripts/test/recovery-e2e.test.mjs +1 -0
- package/skills/a2h-page-specgen/scripts/test/report.test.mjs +80 -1
- package/skills/a2h-page-specgen/scripts/test/submit.test.mjs +159 -27
- package/skills/a2h-page-specgen/scripts/test/waker-process.test.mjs +23 -0
- package/skills/a2h-page-specgen/scripts/waker.mjs +8 -1
- package/skills/a2h-resource-convert/SKILL.md +1 -1
- package/skills/a2h-resource-convert/data/framework-strings/NOTICE +10 -0
- package/skills/a2h-resource-convert/data/framework-strings/manifest.json +90 -0
- package/skills/a2h-resource-convert/data/framework-strings/strings.json +382 -0
- package/skills/a2h-resource-convert/references/conversion-rules.md +7 -1
- package/skills/a2h-resource-convert/references/lottie-conversion-rules.md +2 -2
- package/skills/a2h-resource-convert/references/step5-reference-resolution.md +16 -0
- package/skills/a2h-resource-convert/scripts/a2h_resource_convert.ts +124 -8
- package/skills/a2h-resource-convert/scripts/sync-framework-strings.mjs +147 -0
- package/skills/a2h-resource-convert/scripts/tests/framework_strings.test.mjs +131 -0
- package/skills/a2h-spec-design-pipeline/SKILL.md +14 -11
- package/skills/a2h-spec-design-pipeline/references/coding-loop.md +38 -10
- package/skills/a2h-spec-design-pipeline/references/execution-model.md +3 -0
- package/skills/a2h-spec-design-pipeline/references/final-report-template.md +6 -3
- package/skills/a2h-spec-design-pipeline/references/initialization.md +2 -2
- package/skills/a2h-spec-design-pipeline/references/post-loop.md +2 -2
- package/skills/a2h-spec-design-pipeline/references/reply-recovery.md +172 -0
- package/skills/a2h-spec-design-pipeline/references/review-loop.md +2 -2
- package/skills/a2h-spec-design-pipeline/references/scripts.md +4 -3
- package/skills/a2h-spec-design-pipeline/references/shared-layer.md +24 -19
- package/skills/a2h-spec-design-pipeline/references/state-and-resume.md +7 -1
- package/skills/a2h-spec-design-pipeline/references/static-defect-gate.md +12 -5
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/config/ruleMeta.json +5 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/config/ruleSet.json +4 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/data/README.md +27 -3
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/data/api-param-contract.json +46 -1
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/data/api-permission-map.json +2511 -295
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/api-permission-declared-cn.md +27 -72
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/api-permission-declared-en.md +39 -83
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/arkui-runtime-pitfall-cn.md +132 -101
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/arkui-runtime-pitfall-en.md +158 -115
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/platform-api-contract-cn.md +60 -93
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/platform-api-contract-en.md +73 -100
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/route-page-side-effect-import-cn.md +52 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/route-page-side-effect-import-en.md +59 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/ApiPermissionDeclaredCheck.js +57 -8
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/ArkUIRuntimePitfallCheck.js +475 -18
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/PlatformApiContractCheck.js +472 -4
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/RoutePageSideEffectImportCheck.js +570 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/arkui/RouteParamCarrierSubCheck.js +1053 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/sql/SqlIdentifierAnalysis.js +427 -0
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/index.js +7 -1
- package/skills/a2h-spec-design-pipeline/rules/migration-rules/package.json +1 -1
- package/skills/a2h-spec-design-pipeline/scripts/plan_groups.ts +1 -1
- package/skills/a2h-spec-design-pipeline/scripts/settle.ts +785 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_api_permission_declared.ts +286 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_arkui_runtime_pitfall.ts +166 -2
- package/skills/a2h-spec-design-pipeline/scripts/test_docs_refresh_contract.ts +40 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_plan_groups.ts +2 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_platform_api_contract.ts +350 -7
- package/skills/a2h-spec-design-pipeline/scripts/test_route_page_side_effect_import.ts +185 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_route_param_carrier.ts +341 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_settle.ts +593 -0
- package/skills/a2h-spec-design-pipeline/scripts/test_shared_layer_docs.ts +92 -1
- package/skills/a2h-spec-design-pipeline/scripts/test_sql_identifier_analysis.ts +137 -0
- package/skills/a2h-spec-generate/references/input-formats.md +1 -1
- package/skills/a2h-utg-explorer/SKILL.md +11 -5
- package/skills/a2h-utg-explorer/references/architecture.md +37 -19
- package/skills/a2h-utg-explorer/scripts/audit.mjs +6 -2
- package/skills/a2h-utg-explorer/scripts/close_phases.mjs +8 -5
- package/skills/a2h-utg-explorer/scripts/compile_tasks.mjs +95 -19
- package/skills/a2h-utg-explorer/scripts/d_prereqs.mjs +192 -4
- package/skills/a2h-utg-explorer/scripts/final_utg.mjs +21 -0
- package/skills/a2h-utg-explorer/scripts/panel_routes.mjs +1 -1
- package/skills/a2h-utg-explorer/scripts/plan.mjs +16 -1
- package/skills/a2h-utg-explorer/scripts/predicates.mjs +270 -0
- package/skills/a2h-utg-explorer/scripts/promote_dynamic.mjs +2 -0
- package/skills/a2h-utg-explorer/scripts/recover.mjs +4 -3
- package/skills/a2h-utg-explorer/scripts/recover_d.mjs +67 -8
- package/skills/a2h-utg-explorer/scripts/rejudge.mjs +4 -3
- package/skills/a2h-utg-explorer/scripts/report.mjs +32 -2
- package/skills/a2h-utg-explorer/scripts/run_cycle.mjs +103 -36
- package/skills/a2h-utg-explorer/scripts/run_device.mjs +3 -8
- package/skills/a2h-utg-explorer/scripts/schedule_states.mjs +189 -0
- package/skills/a2h-utg-explorer/scripts/tests/calendar_round_fixes.test.mjs +9 -0
- package/skills/a2h-utg-explorer/scripts/tests/coverage_rules.test.mjs +11 -0
- package/skills/a2h-utg-explorer/scripts/tests/d_prereqs.test.mjs +31 -2
- package/skills/a2h-utg-explorer/scripts/tests/device_lock_retry.test.mjs +1 -1
- package/skills/a2h-utg-explorer/scripts/tests/diagnostics.test.mjs +32 -0
- package/skills/a2h-utg-explorer/scripts/tests/dialog_own_layout.test.mjs +40 -0
- package/skills/a2h-utg-explorer/scripts/tests/explorer_review_fixes.test.mjs +4 -1
- package/skills/a2h-utg-explorer/scripts/tests/hybrid_route.test.mjs +6 -28
- package/skills/a2h-utg-explorer/scripts/tests/in_route_surface.test.mjs +125 -0
- package/skills/a2h-utg-explorer/scripts/tests/list_probe_target_wait.test.mjs +86 -0
- package/skills/a2h-utg-explorer/scripts/tests/multi_host.test.mjs +167 -0
- package/skills/a2h-utg-explorer/scripts/tests/nested_list.test.mjs +58 -0
- package/skills/a2h-utg-explorer/scripts/tests/overlay_opener.test.mjs +100 -0
- package/skills/a2h-utg-explorer/scripts/tests/pipeline.test.mjs +8 -1
- package/skills/a2h-utg-explorer/scripts/tests/pr169_review_fixes.test.mjs +1 -0
- package/skills/a2h-utg-explorer/scripts/tests/pr191_review_fixes.test.mjs +2 -31
- package/skills/a2h-utg-explorer/scripts/tests/review_fixes.test.mjs +1 -1
- package/skills/a2h-utg-explorer/scripts/tests/run_cycle.test.mjs +56 -7
- package/skills/a2h-utg-explorer/scripts/tests/snapshot_integrity.test.mjs +117 -6
- package/skills/a2h-utg-explorer/scripts/tests/state_inventory.test.mjs +414 -0
- package/skills/a2h-utg-explorer/scripts/tests/tree_unreliable.test.mjs +197 -0
- package/skills/a2h-utg-explorer/scripts/utg_explorer/adapters.mjs +196 -30
- package/skills/a2h-utg-explorer/scripts/utg_explorer/hosts.mjs +146 -0
- package/skills/a2h-utg-explorer/scripts/utg_explorer/semantics.mjs +63 -2
- package/skills/a2h-utg-explorer/scripts/utg_explorer/states.mjs +286 -0
- package/skills/a2h-utg-explorer/scripts/utg_explorer/task_runner.mjs +197 -19
- package/skills/a2h-utg-static/SKILL.md +3 -3
- package/skills/a2h-utg-static/references/extractors.md +7 -0
- package/skills/a2h-utg-static/references/ui-elements-static-utg-schema.md +4 -3
- package/skills/a2h-utg-static/scripts/click_paths.mjs +1 -1
- package/skills/a2h-utg-static/scripts/compose_overlay.mjs +642 -22
- package/skills/a2h-utg-static/scripts/tests/test_compose_res_text.mjs +25 -0
- package/skills/a2h-utg-static/scripts/tests/test_in_route_surface.mjs +123 -0
- package/skills/a2h-utg-static/scripts/tests/test_overlay_host_effects.mjs +239 -0
- package/skills/a2h-utg-static/scripts/tests/test_shared_host_depths.mjs +48 -0
- package/skills/a2h-utg-static/scripts/utg_html.mjs +2 -0
- package/skills/a2h-utg-static/tools/convert_static_utg_to_ui_elements.ts +1 -0
- package/i18n/skills/a2h-app-migrate/references/specs.example.json +0 -19
- package/i18n/skills/a2h-batch-ui-align/scripts/databinding_analyzer_design.md +0 -79
- package/i18n/skills/a2h-utg-explorer/scripts/utg_explorer/state_phase.mjs +0 -47
- package/resource/convert_pipeline_process.svg +0 -114
- package/resource/project_architecture.svg +0 -120
- package/resource/set_environment.png +0 -0
- package/resource/set_multimodel.png +0 -0
- package/skills/a2h-app-migrate/references/specs.example.json +0 -19
- package/skills/a2h-batch-ui-align/scripts/databinding_analyzer_design.md +0 -79
- package/skills/a2h-utg-explorer/scripts/utg_explorer/state_phase.mjs +0 -47
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
// Framework strings (`@android:string/*`) resolve per output language from
|
|
2
|
+
// data/framework-strings/strings/<lang>.json. Android renders those strings on the device, so an app
|
|
3
|
+
// never owned the text or its translations; resolving them in English only would turn a localized
|
|
4
|
+
// platform dialog into an English-only HarmonyOS dialog.
|
|
5
|
+
// Run from scripts/: node --test tests/framework_strings.test.mjs
|
|
6
|
+
import { test } from 'node:test';
|
|
7
|
+
import assert from 'node:assert/strict';
|
|
8
|
+
import { spawnSync } from 'node:child_process';
|
|
9
|
+
import * as fs from 'node:fs';
|
|
10
|
+
import * as os from 'node:os';
|
|
11
|
+
import * as path from 'node:path';
|
|
12
|
+
import { fileURLToPath } from 'node:url';
|
|
13
|
+
|
|
14
|
+
const CONVERTER = path.join(path.dirname(fileURLToPath(import.meta.url)), '..', 'a2h_resource_convert.ts');
|
|
15
|
+
const TABLES = JSON.parse(fs.readFileSync(path.join(path.dirname(CONVERTER), '..', 'data', 'framework-strings', 'strings.json'), 'utf8'));
|
|
16
|
+
|
|
17
|
+
const VALUES = (values) => `<?xml version="1.0" encoding="utf-8"?>\n<resources>\n${Object.entries(values)
|
|
18
|
+
.map(([name, value]) => ` <string name="${name}">${value}</string>`).join('\n')}\n</resources>\n`;
|
|
19
|
+
|
|
20
|
+
/** Runs the converter over a temp `res/` tree; returns { project, records }. */
|
|
21
|
+
function convert(qualifiers) {
|
|
22
|
+
const dir = fs.mkdtempSync(path.join(os.tmpdir(), 'rc-fw-'));
|
|
23
|
+
const res = path.join(dir, 'res');
|
|
24
|
+
for (const [qualifier, values] of Object.entries(qualifiers)) {
|
|
25
|
+
const target = path.join(res, qualifier);
|
|
26
|
+
fs.mkdirSync(target, { recursive: true });
|
|
27
|
+
fs.writeFileSync(path.join(target, 'strings.xml'), VALUES(values), 'utf8');
|
|
28
|
+
}
|
|
29
|
+
const project = path.join(dir, 'proj');
|
|
30
|
+
const records = path.join(dir, 'records.json');
|
|
31
|
+
const run = spawnSync(process.execPath, [CONVERTER, '--res', res, '--harmony', project, '--records', records, '--quiet'], { encoding: 'utf8' });
|
|
32
|
+
assert.equal(run.status, 0, run.stderr);
|
|
33
|
+
return { dir, project, records };
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
function element(project, qualifier, name) {
|
|
37
|
+
const file = path.join(project, 'entry', 'src', 'main', 'resources', qualifier, 'element', 'string.json');
|
|
38
|
+
const doc = JSON.parse(fs.readFileSync(file, 'utf8'));
|
|
39
|
+
const hit = doc.string.find((s) => s.name === name);
|
|
40
|
+
return hit ? hit.value : undefined;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
function cleanup(dir) {
|
|
44
|
+
fs.rmSync(dir, { recursive: true, force: true });
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/** Runs the converter over a temp `res/` tree built from raw relative paths. */
|
|
48
|
+
function convertRaw(files) {
|
|
49
|
+
const dir = fs.mkdtempSync(path.join(os.tmpdir(), 'rc-fw-'));
|
|
50
|
+
const res = path.join(dir, 'res');
|
|
51
|
+
for (const [rel, content] of Object.entries(files)) {
|
|
52
|
+
const target = path.join(res, rel);
|
|
53
|
+
fs.mkdirSync(path.dirname(target), { recursive: true });
|
|
54
|
+
fs.writeFileSync(target, content, 'utf8');
|
|
55
|
+
}
|
|
56
|
+
const project = path.join(dir, 'proj');
|
|
57
|
+
const records = path.join(dir, 'records.json');
|
|
58
|
+
const run = spawnSync(process.execPath, [CONVERTER, '--res', res, '--harmony', project, '--records', records, '--quiet'], { encoding: 'utf8' });
|
|
59
|
+
assert.equal(run.status, 0, run.stderr);
|
|
60
|
+
return { dir, project, records };
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
test('a framework string resolves to its English value in base', (t) => {
|
|
64
|
+
const run = convert({ values: { cancel_button: '@android:string/cancel' } });
|
|
65
|
+
t.after(() => cleanup(run.dir));
|
|
66
|
+
assert.equal(element(run.project, 'base', 'cancel_button'), 'Cancel');
|
|
67
|
+
});
|
|
68
|
+
|
|
69
|
+
test('the same framework string resolves to the localized value in ru', (t) => {
|
|
70
|
+
const run = convert({
|
|
71
|
+
values: { cancel_button: '@android:string/cancel' },
|
|
72
|
+
'values-ru': { cancel_button: '@android:string/cancel' },
|
|
73
|
+
});
|
|
74
|
+
t.after(() => cleanup(run.dir));
|
|
75
|
+
assert.equal(element(run.project, 'ru', 'cancel_button'), TABLES.ru.cancel);
|
|
76
|
+
assert.notEqual(element(run.project, 'ru', 'cancel_button'), 'Cancel');
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
test('a language the table does not cover falls back to base and warns', (t) => {
|
|
80
|
+
const run = convert({
|
|
81
|
+
values: { cancel_button: '@android:string/cancel' },
|
|
82
|
+
// Czech is not a bundled language
|
|
83
|
+
'values-cs': { cancel_button: '@android:string/cancel' },
|
|
84
|
+
});
|
|
85
|
+
t.after(() => cleanup(run.dir));
|
|
86
|
+
assert.equal(element(run.project, 'cs', 'cancel_button'), 'Cancel');
|
|
87
|
+
const rec = JSON.parse(fs.readFileSync(run.records, 'utf8'));
|
|
88
|
+
assert.ok(rec.warnings.some((w) => w.includes('@android:string/cancel') && w.includes('cs')),
|
|
89
|
+
`expected a fallback warning, got: ${JSON.stringify(rec.warnings)}`);
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
test('yes/no keep the framework semantics (OK / Cancel), not literal Yes / No', (t) => {
|
|
93
|
+
const run = convert({ values: { yes_label: '@android:string/yes', no_label: '@android:string/no' } });
|
|
94
|
+
t.after(() => cleanup(run.dir));
|
|
95
|
+
assert.equal(element(run.project, 'base', 'yes_label'), TABLES.en.yes);
|
|
96
|
+
assert.equal(element(run.project, 'base', 'no_label'), TABLES.en.no);
|
|
97
|
+
assert.equal(TABLES.en.yes, 'OK');
|
|
98
|
+
assert.equal(TABLES.en.no, 'Cancel');
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
test('re-running the conversion produces byte-identical resources', (t) => {
|
|
102
|
+
const first = convert({ values: { cancel_button: '@android:string/cancel' }, 'values-ru': { cancel_button: '@android:string/cancel' } });
|
|
103
|
+
const second = convert({ values: { cancel_button: '@android:string/cancel' }, 'values-ru': { cancel_button: '@android:string/cancel' } });
|
|
104
|
+
t.after(() => cleanup(first.dir));
|
|
105
|
+
t.after(() => cleanup(second.dir));
|
|
106
|
+
for (const qualifier of ['base', 'ru']) {
|
|
107
|
+
const a = fs.readFileSync(path.join(first.project, 'entry', 'src', 'main', 'resources', qualifier, 'element', 'string.json'), 'utf8');
|
|
108
|
+
const b = fs.readFileSync(path.join(second.project, 'entry', 'src', 'main', 'resources', qualifier, 'element', 'string.json'), 'utf8');
|
|
109
|
+
assert.equal(a, b, qualifier);
|
|
110
|
+
}
|
|
111
|
+
});
|
|
112
|
+
test('a framework string referenced only from a style is emitted as a localized fw_ key', (t) => {
|
|
113
|
+
const style = (value) => [
|
|
114
|
+
'<?xml version="1.0" encoding="utf-8"?>',
|
|
115
|
+
'<resources>',
|
|
116
|
+
' <style name="AppDialog" parent="Preference.DialogPreference">',
|
|
117
|
+
` <item name="android:negativeButtonText">${value}</item>`,
|
|
118
|
+
' <item name="android:positiveButtonText">@android:string/ok</item>',
|
|
119
|
+
' </style>',
|
|
120
|
+
'</resources>',
|
|
121
|
+
'',
|
|
122
|
+
].join('\n');
|
|
123
|
+
const run = convertRaw({
|
|
124
|
+
'values/styles.xml': style('@android:string/cancel'),
|
|
125
|
+
'values-ru/styles.xml': style('@android:string/cancel'),
|
|
126
|
+
});
|
|
127
|
+
t.after(() => cleanup(run.dir));
|
|
128
|
+
assert.equal(element(run.project, 'base', 'fw_cancel'), 'Cancel');
|
|
129
|
+
assert.equal(element(run.project, 'ru', 'fw_cancel'), TABLES.ru.cancel);
|
|
130
|
+
assert.equal(element(run.project, 'base', 'fw_ok'), TABLES.en.ok);
|
|
131
|
+
});
|
|
@@ -27,6 +27,7 @@ Deterministic precomputation lives in the scripts (inventory: `references/script
|
|
|
27
27
|
| `references/scripts.md` | script + test inventory | as needed |
|
|
28
28
|
| `references/post-loop.md` | after the wave loop: Homecheck → smoke gate → Finalization, with their markers | after the last wave |
|
|
29
29
|
| `references/static-defect-gate.md` | Homecheck static-defect gate | before smoke |
|
|
30
|
+
| `references/reply-recovery.md` | host-independent reply recovery (F0/B3/B4 rebuild/build breaker/post-gate build-fixer) | before dispatching a foreground stage agent |
|
|
30
31
|
| `references/final-report-template.md` | Finalization summary template | at Finalization |
|
|
31
32
|
|
|
32
33
|
**Execution model — every stage runs in an isolated sub-agent** (details at I5): the orchestrator parses compact JSON results, runs the scripts and git/worktree bookkeeping itself, and dispatches the next stage. Only B1 chunk agents and B2 conflict resolvers are background dispatches; user interaction is confined to Initialization — after I4 the run is autonomous (per-group failures logged, never paused). Background completion notifications are the run's only immediate wakeup source, and one that never arrives strands the whole wave — so every background dispatch is claimed on the on-disk **dispatch ledger** (`dispatch.mjs`) before it leaves, and a durable **waker** (`dispatch.mjs waker`) holds a wakeup independently of any notification (discipline: `references/execution-model.md`).
|
|
@@ -52,6 +53,7 @@ Parse the arguments from the user's message (natural language is fine — no fix
|
|
|
52
53
|
| `IMAGE_READ` | `--image-read true\|false`: whether this host's sub-agents can read image files (a2h-app-migrate probes it at bootstrap). `false` → every sub-agent prompt carries the no-image rule of I5. Never probe it by opening an image in this session | `true` |
|
|
53
54
|
| `SHARED_LAYER` | `auto` (default) or `off`; persisted in `state.config.shared_layer` | `auto` |
|
|
54
55
|
| `SOURCE_KIND` | optional `android` (default) or `uniapp`; persisted in `state.config.source_kind`. No current caller passes it (`a2h-app-migrate` exports no `SOURCE_KIND` variable), so it defaults to `android` and only labels the F0 agent's source-evidence reading — scanning is project-neutral | `android` |
|
|
56
|
+
| `WAIT_MODE` | `background` (default): B1 ends the turn and waits for notifications / the waker. `foreground`: this run is itself a dispatched sub-agent (e.g. under `a2h-app-migrate`) whose ended turn would return to its caller — B1 never ends the turn; it blocks in `dispatch.mjs wait` instead and arms no waker (`references/coding-loop.md` → Foreground wait mode) | `background` |
|
|
55
57
|
|
|
56
58
|
### specs.json format
|
|
57
59
|
|
|
@@ -62,15 +64,16 @@ The format is owned by the producing skill (`a2h-spec-generate`'s `publish-specs
|
|
|
62
64
|
Apply **`references/initialization.md` verbatim** (its steps I1–I4 = the numbered steps 1–12). This is the run's **only** interactive window; everything after I4 is autonomous. The stages:
|
|
63
65
|
|
|
64
66
|
- **I1 — inputs, grouping precompute, wiring surface.** `plan_groups.ts` (`--emit-state` on a fresh run; without it on a resume, where exit 3 = specs.json changed → stop) writes `spec_group_plan.json`, one `spec_group_<G>/merged_spec.md` per group, and — on a fresh run — the state seed; `resolve_wiring.ts` fills `state.config.wiring_files` (three tiers; skipped on a resume when the field already exists, so user corrections survive). Every later stage reads their JSON — never re-derive paths, counts, or membership by hand.
|
|
65
|
-
- **I2 — environment prerequisites.** `DEVECO_HOME` resolving, `<HMOS>` a git repo, Node ≥ 22.18, both HomeGraph indexes (`ensure_index.ts <ANDROID> --create --sync`, trigger `i2-android`, and `<HMOS> --create --sync`, trigger `i2-hmos`; `ENGINE_MODE=off` skips), the semantic docs (`project_design.md` required, `database_design.md` / `preferences_design.md` optional), Homecheck availability and rule sets, then `
|
|
67
|
+
- **I2 — environment prerequisites.** `DEVECO_HOME` resolving, `<HMOS>` a git repo, Node ≥ 22.18, both HomeGraph indexes (`ensure_index.ts <ANDROID> --create --sync`, trigger `i2-android`, and `<HMOS> --create --sync`, trigger `i2-hmos`; `ENGINE_MODE=off` skips), the semantic docs (`project_design.md` required, `database_design.md` / `preferences_design.md` optional), Homecheck availability and rule sets, then `STATE_DOCS_MODE`, `API_DOCS_MODE`, `MVVM_MODE`, `MAX_ROUNDS_REVIEW`.
|
|
66
68
|
- **I3 — one-time setup.** Create `DESIGN_DIR`; `git_baseline.ts` (gitignores `.hometrans/` + `.homegraph/` and commits a fresh scaffold as `pre-campaign baseline` so W0 has a `WAVE_BASE` and a clean tree); seed the semantic-docs baseline once.
|
|
67
69
|
- **I4 — announce, then commit to autonomous execution.** Announce the plan table, flags, warnings, the git baseline and the wiring-surface summary — the one window for user corrections — then no prompts and no mid-run branching (per-group failures are recorded and skipped).
|
|
68
70
|
|
|
69
71
|
### I5 — Execution model
|
|
70
72
|
|
|
71
73
|
- Every sub-skill run happens in a **fresh sub-agent** via the `Agent` tool. The prompt must (1) name the sub-skill/agent and its exact inputs, (2) forbid asking back — on ambiguity take the documented safe default or return `{ "ok": false, "note": ... }`, (3) require the final message to be **only** a compact JSON object, (4) when `IMAGE_READ` is `false`, open with `Do not open any image file (.png/.jpg/.jpeg/.webp/.gif): image content crashes this host session; use view trees, measure files and source instead.` — this covers coders, resolvers, build-fixers, reviewers and the watchdog sentinel alike. A sub-agent that still dies on image content (`messages.content.type` invalid; it cannot be resumed) sets `IMAGE_READ=false` for the rest of the run (persist it in the state file) and is redispatched fresh with the rule; the final report says so.
|
|
74
|
+
- **Docs-refresh reply contract** (when this skill dispatches the I3 baseline seed, F0 docs refresh or B5): reply only `{ "ok": true, "modules_updated": N, "modules_total": M }` or `{ "ok": false, "note": "..." }`; `modules_updated` = the `module_design.md` files it wrote, `modules_total` = modules in `module_structure.json`. The docs-refresh sub-agent never commits; the orchestrator makes the docs commit.
|
|
72
75
|
- Sub-skill SKILL.md text never enters this orchestrator's context during the wave loop (the exception: the runtime smoke gate, run by the orchestrator itself).
|
|
73
|
-
- The orchestrator itself runs: the deterministic scripts (`plan_groups.ts`, `resolve_wiring.ts`, `git_baseline.ts`, `stage_design_inputs.ts`, `ensure_index.ts`, `plan_waves.ts`, `scan_shared.ts`, `validate_shared_manifest.ts`, `deps_ready.ts`, `branch_landed.ts`, `resolver_prompt.ts`, `audit_claims.ts`, `dispatch.mjs` — the ledger's only writer), git/worktree/merge/wiring/commit bookkeeping, the single-writer HomeGraph index lifecycle of `<ANDROID>` (I2 only) and `<HMOS>` (I2, resume, W0, B2 landing, B2 hop-b, B3/build-breaker fix, B4 step 0/fix/rebuild, B5 — all via `ensure_index.ts`), state-file updates, dispatch discipline (including dispatching the post-loop Homecheck gate sub-agent and validating its JSON reply — the scan/fix/build-check work itself, `homecheck_scan.ts` included, belongs to that sub-agent), and the post-loop runtime smoke gate; nothing else. Coders, reviewers, fixers, resolvers and the semantic-docs sub-agent are read-only consumers of those indexes.
|
|
76
|
+
- The orchestrator itself runs: the deterministic scripts (`plan_groups.ts`, `resolve_wiring.ts`, `git_baseline.ts`, `stage_design_inputs.ts`, `ensure_index.ts`, `plan_waves.ts`, `scan_shared.ts`, `validate_shared_manifest.ts`, `deps_ready.ts`, `settle.ts`, `branch_landed.ts`, `resolver_prompt.ts`, `audit_claims.ts`, `dispatch.mjs` — the ledger's only writer), git/worktree/merge/wiring/commit bookkeeping, the single-writer HomeGraph index lifecycle of `<ANDROID>` (I2 only) and `<HMOS>` (I2, resume, W0, B2 landing, B2 hop-b, B3/build-breaker fix, B4 step 0/fix/rebuild, B5 — all via `ensure_index.ts`), state-file updates, dispatch discipline (including dispatching the post-loop Homecheck gate sub-agent and validating its JSON reply — the scan/fix/build-check work itself, `homecheck_scan.ts` included, belongs to that sub-agent), and the post-loop runtime smoke gate; nothing else. Coders, reviewers, fixers, resolvers and the semantic-docs sub-agent are read-only consumers of those indexes.
|
|
74
77
|
- **Ledger + waker discipline.** Every background dispatch is `claim` → seed the foreground baseline → `intent` → Agent → `confirm` (the session id proves liveness); progress is `beat`; a completion is `artifact` + `submit` then `release`. Only `dispatch.mjs` writes the ledger. Before ending a turn with active units, run `dispatch.mjs probe`: `inPlace:false` (or a different `runId`) → arm the durable waker as one background sub-agent running `dispatch.mjs waker`; its `dispatch/waker.event.json` is consumed at the start of **every** turn (verify `runId`, delete after reading). Write `dispatch/waker.stop` on every terminal path — wave barrier, resume, abort, Finalization.
|
|
75
78
|
- A returned sub-agent result — success or failure — is never a stop: parse it, persist it, dispatch the next.
|
|
76
79
|
|
|
@@ -105,11 +108,11 @@ It appends the wave to `<HMOS>/.hometrans/spec_wave_plan.json` (schema `spec_wav
|
|
|
105
108
|
|
|
106
109
|
### F0 — shared-layer pre-seeding
|
|
107
110
|
|
|
108
|
-
Before W0, run `node <skill-dir>/scripts/scan_shared.ts <HMOS> --wave <K>`. `SHARED_LAYER=off` → write a skipped manifest with `reason:"disabled"` and continue to W0 without scanning or dispatching. Scanner exit `2` (missing/unparseable input) → skipped manifest `reason:"failed:2"` and continue to W0 — no `PRE_F0` exists, so nothing to reset. `skip:true` → write the skipped manifest from `references/shared-layer.md` and continue to W0. Otherwise assert the main tree is clean, record `PRE_F0 = git rev-parse HEAD`, write `wave_<K>/shared_inflight.json` (`campaign_id`, `pre`, `wiring_files`, `wiring_compact`), and dispatch one foreground `general` sub-agent with `references/shared-layer.md`; resolve that prompt's `entry_module` / `entry_module_json5` / `entry_module_strings` fields from `build-profile.json5` (`type:"entry"`) before dispatch.
|
|
111
|
+
Before W0, run `node <skill-dir>/scripts/scan_shared.ts <HMOS> --wave <K>`. `SHARED_LAYER=off` → write a skipped manifest with `reason:"disabled"` and continue to W0 without scanning or dispatching. Scanner exit `2` (missing/unparseable input) → skipped manifest `reason:"failed:2"` and continue to W0 — no `PRE_F0` exists, so nothing to reset. `skip:true` → write the skipped manifest from `references/shared-layer.md` and continue to W0. Otherwise assert the main tree is clean, record `PRE_F0 = git rev-parse HEAD`, write `wave_<K>/shared_inflight.json` (`campaign_id`, `pre`, `wiring_files`, `wiring_compact`), write the reply-recovery baseline (`node <skill-dir>/scripts/settle.ts <HMOS> --init --stage f0 --wave <K> --dispatch-at <DISPATCH_AT> --campaign-id <campaign_id> --base <PRE_F0>`), and dispatch one foreground `general` sub-agent with `references/shared-layer.md`; resolve that prompt's `entry_module` / `entry_module_json5` / `entry_module_strings` fields from `build-profile.json5` (`type:"entry"`) before dispatch.
|
|
109
112
|
|
|
110
|
-
After it returns, apply
|
|
113
|
+
After it returns, apply **`references/reply-recovery.md`** with `stage: f0`: a parseable reply goes to the manifest validation below; an unparseable one runs the disk settle ladder — never a session resume — and only `artifact_fresh` ends it. Then branch on `wave_<K>/shared_manifest.json` status: `done` → run `node <skill-dir>/scripts/validate_shared_manifest.ts <HMOS> --wave <K> --base <PRE_F0>` (non-resume: `HEAD` must equal the F0 commit); `skipped` (including `declined:*`) → valid **only when the agent made no commit**: require `git rev-parse HEAD` == `PRE_F0`, record the reason, and continue to W0 without the done validator. A skipped manifest whose `HEAD` moved is an **unrecorded-commit anomaly** — not a skip and not a rollback case: record `failed:post_agent_commit`, restore the wiring snapshot, and **stop for manual recovery**; never reset or delete those commits. Any other post-agent failure with a recorded F0 commit → the **ownership-guarded rollback** in `references/shared-layer.md` (`git reset --hard PRE_F0` + `git clean -fd` only in the two recorded cases — `HEAD == commit`, or `HEAD == docs_commit` whose parent is `commit` — and only when every dirty path is F0's own; otherwise stop under the dirty-tree rule), restore `wiring_files`/`wiring_compact` from `shared_inflight.json`, write the skipped manifest, continue W0. On success: append the module's new barrel/wiring **and any `modules[].files` matching a wiring category** (`Index.ets`, the `getRdbStore` registration file, `module.json5`, `oh-package.json5`) to `state.config.wiring_files` + refresh `wiring_compact`. Before W0, if `database_design`/`preferences_design` resolved to a root-only file and `.hometrans/<name>.md` is missing, copy it verbatim into `.hometrans/`. Then run the docs-refresh procedure in `references/shared-layer.md` ("Docs refresh / visibility"): a `docs(wave K)` commit only when tracked `.hometrans` docs changed; `WAVE_BASE = docs_commit ?? infra commit`.
|
|
111
114
|
|
|
112
|
-
**Permissions ride along.** When F0 dispatches (this wave has shared candidates), the same agent also declares the permissions this wave's specs require in the **entry** module's `module.json5` (`requestPermissions` appended, never rewritten; the wave's specs gate the set and the source manifest only confirms it; every name is looked up in the framework docs (a Kit's
|
|
115
|
+
**Permissions ride along.** When F0 dispatches (this wave has shared candidates), the same agent also declares the permissions this wave's specs require in the **entry** module's `module.json5` (`requestPermissions` appended, never rewritten; the wave's specs gate the set and the source manifest only confirms it; every name is looked up in the framework docs (a Kit's permission-application page) and must exist in `references/permission-index.json`; `user_grant` entries with `reason` + `usedScene`) inside the same `infra(wave K)` commit — the pre-W0 window, so every coder starts from an already-declared module. A skipped F0 declares nothing: those permissions keep the B1 `add-permission` wiring-row path applied at B2. Runtime consent (`requestPermissionsFromUser`) stays the chunk coder's work, and every file edited for permissions is listed in the first `modules[]` entry's `wiring[]` (a reporting bucket, never an ownership claim).
|
|
113
116
|
|
|
114
117
|
See `references/shared-layer.md` for the authoritative prompt and manifest.
|
|
115
118
|
|
|
@@ -155,13 +158,13 @@ Apply **`references/merge-queue.md` verbatim.** B2 is a queue the B1 event loop
|
|
|
155
158
|
|
|
156
159
|
### B3 — One build per wave
|
|
157
160
|
|
|
158
|
-
|
|
161
|
+
Write the reply-recovery baseline (`node <skill-dir>/scripts/settle.ts <HMOS> --init --stage b3 --wave <wave> --dispatch-at <DISPATCH_AT> --output <HMOS>/.hometrans/wave_<wave>/build --pre-head <PRE_HEAD>`, where `PRE_HEAD` is the full SHA from `git rev-parse HEAD`, not a short sha; `--force` only on a re-dispatch after confirming the old agent is gone) immediately before the call, then dispatch one `build-fixer` sub-agent (`harmony_project_dir: <HMOS>`, `deveco_home: <DEVECO_HOME>`, `output_path: <HMOS>/.hometrans/wave_<wave>/build` — the agent's field names) in the foreground. It fixes cross-group compile errors and replies with one JSON object `{ ok, build, commit, fixes, report, note }`. (`FAILED` → record; the wave still runs B4–C, but no later wave starts on a red build: coding-loop.md → Build breaker.)
|
|
159
162
|
|
|
160
163
|
**Validate the reply before moving on — never end the turn to wait for B3.** A foreground sub-agent call returns at the sub-agent's first idle. Nothing it does after that reaches you: no notification follows, and no ledger row or waker covers B3. An orchestrator that ends its turn here hangs forever.
|
|
161
164
|
|
|
162
165
|
1. The reply parses as that JSON and `build` is `SUCCESS` or `FAILED` → record `build` and `commit` (`null` = no fix commit). If `commit` is non-null, check it with `git -C <HMOS> cat-file -e <commit>`, then run `node <skill-dir>/scripts/ensure_index.ts <HMOS> --sync` (trigger `b3-fix`, also labelled `build-breaker` — the design's build-breaker row is this same B3 build-fixer commit; skip when `ENGINE_MODE=off`; record the JSON line — a degraded refresh never invalidates the build). A missing commit counts as an invalid reply (step 2).
|
|
163
|
-
2. Any other reply (a status line such as "will resume automatically when the background task finishes", prose, a truncated object) means the sub-agent went idle **mid-run**, typically behind its own background build, and may still be editing `<HMOS>`. **Never dispatch a second build-fixer beside it
|
|
164
|
-
3.
|
|
166
|
+
2. Any other reply (a status line such as "will resume automatically when the background task finishes", prose, a truncated object) means the sub-agent went idle **mid-run**, typically behind its own background build, and may still be editing `<HMOS>`. **Never dispatch a second build-fixer beside it, and never resume a session.** Apply **`references/reply-recovery.md`** with `stage: b3` and this wave's build dir as `output_path`. Its verdict decides: `artifact_fresh` → validate as step 1; `settled_empty` → run the build yourself (step 3) — the build stages' `QUIET_MS` exceeds the build's own timeout, so no concurrent build remains; `settled_timeout` → **stop for manual recovery**: record `build: "FAILED"` with `note: "reply-recovery: settled_timeout"`, do **not** build inline, and do **not** continue B4–C (a live writer may still own main; C's `git add -A` must not run).
|
|
167
|
+
3. **Only on `settled_empty` (or a fresh report)** take the result from disk: `<output_path>/build-fix-report.md` (Build Status) and `<output_path>/build-fix-commit-info.md` (`commit_id`). Stale/invalid artifacts are never adopted; `settled_timeout` never reaches this step. If neither is fresh (missing, stale, or invalid), run one build yourself, in the foreground with a 600000 ms timeout (`cmd /c "devecocli build > "<output_path>\b3_orchestrator.log" 2>&1"` from `<HMOS>`), and record its outcome as the B3 build status. Note the invalid reply in the final report either way.
|
|
165
168
|
|
|
166
169
|
### B4 — Unified review (parallel per group, per-group serial fix, only open groups re-reviewed)
|
|
167
170
|
|
|
@@ -179,8 +182,8 @@ Apply **`references/review-loop.md` verbatim** — read it before the wave's fir
|
|
|
179
182
|
|
|
180
183
|
### B5 — One semantic-docs refresh per wave
|
|
181
184
|
|
|
182
|
-
Run
|
|
183
|
-
Then write `wave_<K>/docs_refresh.json` `{wave,
|
|
185
|
+
Run `/a2h-module-semantic-docs <HMOS> --engine-mode <ENGINE_MODE> --homegraph-index <ready|missing> --incremental preserve --scope project-source` **via a sub-agent**. `<ready|missing>` is the orchestrator's `<HMOS>` index verdict; under `ready` the docs sub-agent reads the shared index only (never `init`/`sync`/`index`), under `missing` it records the degradation and never probes. If B5 changed a code file listed in `state.config.wiring_files`, run `node <skill-dir>/scripts/ensure_index.ts <HMOS> --sync` (trigger `b5`; skip when `ENGINE_MODE=off`; a docs-only refresh writes no index). Sets every non-failed spec of the wave to `stage: "B2"`.
|
|
186
|
+
Then write `wave_<K>/docs_refresh.json` `{wave, result, at}`, copying `result` from the sub-agent's reply (the docs-refresh reply contract in I5) — never self-assessed; retry an unparseable/failed reply once first, and if it stays unparseable record `{ok:false, note:"unparseable reply"}`.
|
|
184
187
|
|
|
185
188
|
### C — Per-group finalize
|
|
186
189
|
|
|
@@ -206,8 +209,8 @@ Full schema, sibling-file ownership, the atomic-write rule, the `.bak` restore p
|
|
|
206
209
|
- A parked merge whose resolver unit is terminal — `orphaned` (a phantom/zombie dispatch) or `closed` — → the ladder advances **without hop (a)**: hop (b) group re-code if a generation remains, else hop (c) fail-soft (group `failed`, merge dropped) — same turn (never-strand guard).
|
|
207
210
|
- Merge ladder exhausted → group `failed`, continue (report flags dependents).
|
|
208
211
|
- A merge or queue refused with `chunks-incomplete` → `dequeue-merge <G>` if queued, then: a still-`coding` group finishes the remaining chunks (a `closed`/`abandoned` chunk means `group-fail`); a `merged`/`done` group is a premature landing → `group-reopen <G> --base <current main HEAD>` (new generation, finished chunks kept), then continue B1; if no generation remains, `group-fail`. Never call `group-reopen` on a `coding` group (it refuses `not-merged`), never mark the open chunks done, and never leave them to the final report. A `terminal-group-open-chunks` residue row is the `merged`/`done` repair.
|
|
209
|
-
- B3/B4/B5 failures → record and continue (carried in the final report).
|
|
210
|
-
- The only legitimate stops: the wave loop + Finalization complete, an environment prerequisite Initialization was supposed to guarantee is unrecoverable (e.g. dirty main tree at W0), the F0 **unowned-history anomaly** (`failed:post_agent_commit` — a skipped manifest whose `HEAD` moved with no recorded commit; stop for manual recovery, never reset or delete those commits), or an `ENGINE_MODE=required` engine failure (`state.engine_blocked = { index: "android" | "hmos", reason, at }` — persist the failing index, stop the waker, leave the ledger/worktrees intact; a resume retries exactly that index with `--create --sync`).
|
|
212
|
+
- B3/B4/B5 failures → record and continue (carried in the final report). A reply-recovery `settled_timeout` is **not** this case — see the stops below.
|
|
213
|
+
- The only legitimate stops: the wave loop + Finalization complete, an environment prerequisite Initialization was supposed to guarantee is unrecoverable (e.g. dirty main tree at W0), the F0 **unowned-history anomaly** (`failed:post_agent_commit` — a skipped manifest whose `HEAD` moved with no recorded commit; stop for manual recovery, never reset or delete those commits), a **reply-recovery `settled_timeout`** at any foreground stage (`references/reply-recovery.md` — a live writer may still own main; never continue C or run an inline build), or an `ENGINE_MODE=required` engine failure (`state.engine_blocked = { index: "android" | "hmos", reason, at }` — persist the failing index, stop the waker, leave the ledger/worktrees intact; a resume retries exactly that index with `--create --sync`).
|
|
211
214
|
|
|
212
215
|
## After the wave loop — Homecheck → smoke gate → Finalization
|
|
213
216
|
|
|
@@ -179,9 +179,13 @@ below in order (the spec §11 loop; reconcile is the pivot, not a second source
|
|
|
179
179
|
9. **End of pass — the only exits.**
|
|
180
180
|
- `complete` (step 8) → leave the loop; continue at B3.
|
|
181
181
|
- A unit is active (claimed / dispatched / live / submitted) → its background agent's completion
|
|
182
|
-
notification, or the armed waker (`probe` above), starts the next turn: **end the turn now
|
|
182
|
+
notification, or the armed waker (`probe` above), starts the next turn: **end the turn now**
|
|
183
|
+
(`WAIT_MODE=foreground`: never — see Foreground wait mode below). Never
|
|
183
184
|
sit in a foreground `wait` or `sleep` while an agent runs: a blocked turn does not receive its
|
|
184
185
|
completion notification (measured: 16–30 polling rounds per batch while the notifications waited).
|
|
186
|
+
This ban is scoped to an **active ledger unit**; the settle ladder for F0 / B3 / B4 rebuild /
|
|
187
|
+
build breaker / post-Homecheck build-fixer is the no-unit case and is governed by
|
|
188
|
+
`references/reply-recovery.md`.
|
|
185
189
|
- No unit is active and not complete (only a deadline can move the wave: a held group, a timeout) →
|
|
186
190
|
`dispatch.mjs <HMOS> wait --max-wait 120 --poll 5 --baseline <HMOS>/.hometrans/dispatch/snapshots/orch.snapshot.json
|
|
187
191
|
--event-file <HMOS>/.hometrans/dispatch/orch.event.json` (it persists its event before returning, so
|
|
@@ -210,7 +214,23 @@ below in order (the spec §11 loop; reconcile is the pivot, not a second source
|
|
|
210
214
|
- **Pending member with no worktree** (the dispatch-hold shape): route by `deps_ready.ts` — `held` →
|
|
211
215
|
not dispatched; `ready` → step 6's release procedure, **never a bare chunk dispatch**.
|
|
212
216
|
|
|
213
|
-
**
|
|
217
|
+
**Foreground wait mode (`WAIT_MODE=foreground`).** The pipeline itself runs inside a dispatched
|
|
218
|
+
sub-agent, so an ended turn returns to the caller with the wave unfinished and no notification can wake
|
|
219
|
+
it again. Chunk and resolver agents are still dispatched in background (slots keep refilling); only the
|
|
220
|
+
wait changes:
|
|
221
|
+
- Step 9's `end-turn` exit (and `next`'s `end-turn`) becomes the foreground `wait`: `dispatch.mjs <HMOS>
|
|
222
|
+
wait --max-wait 300 --poll 5 --baseline <HMOS>/.hometrans/dispatch/snapshots/orch.snapshot.json
|
|
223
|
+
--event-file <HMOS>/.hometrans/dispatch/orch.event.json` (shell timeout ≥ 600000 ms), then step 1. Exit 5
|
|
224
|
+
(timeout) also goes to step 1, whose `progress` → `beat` keeps long agents inside their lease.
|
|
225
|
+
- No waker is armed and no waker sub-agent is dispatched: the foreground `wait` watches the same
|
|
226
|
+
ledger / attempt artifacts / worktree git files / deadlines, so a finished agent is found from its
|
|
227
|
+
evidence, not its notification. The never-strand rule "a turn may end only with a live waker" reads
|
|
228
|
+
"the turn never ends while a unit is active"; `waker.stop` on terminal paths stays (harmless when no
|
|
229
|
+
waker runs). Completion notifications that still arrive are consumed in step 1 as usual.
|
|
230
|
+
- The turn ends only at the legitimate stops (Finalization done, or a hard stop), with the final report.
|
|
231
|
+
The "never sit in a foreground `wait`" rule above is for `background` mode only.
|
|
232
|
+
|
|
233
|
+
**Waker arming** (`WAIT_MODE=background` only). When active units remain: `dispatch.mjs <HMOS> probe` → if `inPlace:false` or
|
|
214
234
|
`runId` differs, clear a stale stop file and dispatch a general-purpose sub-agent in **background mode**
|
|
215
235
|
whose entire task is one shell call (timeout 0): `node <skill-dir>/scripts/dispatch.mjs <HMOS> waker
|
|
216
236
|
--interval 30`. Its final message is only `{ "code": <exit> }`. It occupies no concurrency slot and is
|
|
@@ -278,13 +298,14 @@ its artifacts.
|
|
|
278
298
|
proposes against the existing APIs.
|
|
279
299
|
- `state-docs-mode`: `<state.config.state_docs_mode>` (`available` / `unavailable`) — the coder's
|
|
280
300
|
state-management doc gate reads it (`a2h-arkts-logic-coder` → `references/code-generation.md`
|
|
281
|
-
Step 2).
|
|
282
|
-
`references/ISSUES.md
|
|
283
|
-
|
|
301
|
+
Step 2). `unavailable` skips the `devecocli docs` wrapper and records `state-docs: unavailable`;
|
|
302
|
+
the coder still reads its own `references/ISSUES.md` in full. Never paste the doc rules or a doc
|
|
303
|
+
key list into the prompt — the coder skill owns them.
|
|
284
304
|
- `api-docs-mode`: `<state.config.api_docs_mode>` (`available` / `unavailable`, `unavailable` when the
|
|
285
305
|
field is absent) — the coder's soft platform-API doc gate reads it (`references/code-generation.md`
|
|
286
|
-
Step 2, "Platform API doc gate").
|
|
287
|
-
|
|
306
|
+
Step 2, "Platform API doc gate"). `unavailable` only skips the API lookups (local `.d.ts`); the
|
|
307
|
+
coder still reads its own `references/ISSUES.md` in full. Independent of `state-docs-mode`; never
|
|
308
|
+
paste the lookup rules, the catalogue names, or the `api-*` key list into the prompt.
|
|
288
309
|
- shared indexes: `<HMOS>/.homegraph/` (main tree — reference for existing APIs, shared layers and call
|
|
289
310
|
chains) and `<ANDROID>/.homegraph/` (the source implementation). Both are read-only for the coder; the
|
|
290
311
|
orchestrator is the only writer. There is no worktree index. **No usable index** (that repo's
|
|
@@ -324,7 +345,9 @@ warning under `auto`.
|
|
|
324
345
|
`## HomeGraph evidence`."
|
|
325
346
|
- prompt extra: "Implement all scenarios in the given spec-file (the slice already contains only this
|
|
326
347
|
chunk's specs). Every commit message MUST start with the so-ids implemented in that commit
|
|
327
|
-
('so-26,so-27: ...'). Resume note: so-<id> is already committed; continue the implementation from so-<next
|
|
348
|
+
('so-26,so-27: ...'). Resume note: so-<id> is already committed; continue the implementation from so-<next>. **Pre-code rule**: read your
|
|
349
|
+
own skill's `references/ISSUES.md` in full before any edit (not a grep summary), regardless of the
|
|
350
|
+
doc modes. **Code-first rule**: the
|
|
328
351
|
design document's semantic descriptions may lag the actual code — always treat the ACTUAL code in this
|
|
329
352
|
worktree as ground truth; when an implementation already exists, reuse/extend it instead of rewriting;
|
|
330
353
|
the design's anchors (UI/data/logic file paths) locate the code and impose no file-scope restriction.
|
|
@@ -350,8 +373,13 @@ A wave whose B3 build (or B4's last review-round build) ended `FAILED` still run
|
|
|
350
373
|
next wave never codes on a red main: every coder of wave K+1 would branch from code that does not compile,
|
|
351
374
|
and their own build would fail for reasons outside their chunk. Before the next wave's W0:
|
|
352
375
|
|
|
353
|
-
1.
|
|
354
|
-
|
|
376
|
+
1. Write the reply-recovery baseline (`node <skill-dir>/scripts/settle.ts <HMOS> --init --stage
|
|
377
|
+
build-breaker --wave <K+1> --dispatch-at <DISPATCH_AT> --output
|
|
378
|
+
<HMOS>/.hometrans/wave_<K+1>/prebuild --pre-head <PRE_HEAD>`) and dispatch one `build-fixer` against
|
|
379
|
+
`<HMOS>` (the same `output_path`), validating its reply as in B3 (probe with
|
|
380
|
+
`--stage build-breaker --wave <K+1>`). `settled_empty` runs the
|
|
381
|
+
inline build; `settled_timeout` **stops for manual recovery** — no later wave starts and no
|
|
382
|
+
inline build runs (`references/reply-recovery.md`).
|
|
355
383
|
2. `SUCCESS` → start wave K+1 as usual.
|
|
356
384
|
3. Still `FAILED` → start no further wave. Go to the Homecheck gate / Finalization; the remaining groups stay
|
|
357
385
|
`pending`, and the final report lists `waves not started: build still red after wave K` with the fixer's
|
|
@@ -62,7 +62,7 @@ stable and cross-referenced by the rest of the skill (I5 continues them in `SKIL
|
|
|
62
62
|
default stays 300000 ms.
|
|
63
63
|
6. Confirm the semantic docs the B1 design step reads: `project_design.md` (required; resolved from `<HMOS>/.hometrans/`), `database_design.md` / `preferences_design.md` (optional). If `project_design.md` is absent the I3 baseline seed **must** run.
|
|
64
64
|
6b. Validate `DESIGN_DIR`: it may be absent (I3 creates it), must not be a file, must not equal `HMOS`, must not be a symlink/junction pointing outside `HMOS`; when it exists inside `HMOS`, `git -C <HMOS> ls-files -- <rel>` must be empty. Abort on violation.
|
|
65
|
-
7.
|
|
65
|
+
7. Confirm the semantic-docs path: a sub-agent invoking `a2h-module-semantic-docs`. Do not probe invocability here — the first real use is the I3 baseline seed (step 10) when `project_design.md` is absent, or the first wave's B5 otherwise.
|
|
66
66
|
7b. Resolve `STATE_DOCS_MODE` (`available` | `unavailable`) once, for the coder's state-management doc gate (`a2h-arkts-logic-coder` → `references/code-generation.md` Step 2). Probe with one bounded search — this also builds the local docs index once, before any worktree coder pays for it:
|
|
67
67
|
|
|
68
68
|
```
|
|
@@ -94,7 +94,7 @@ stable and cross-referenced by the rest of the skill (I5 continues them in `SKIL
|
|
|
94
94
|
```
|
|
95
95
|
|
|
96
96
|
Gitignores `.hometrans/` + `.homegraph/` (an in-repo custom design dir is appended to `.gitignore`); before the first wave, commits an unborn-HEAD / dirty tree (a fresh scaffold: only `git init`, upstream output uncommitted) as `pre-campaign baseline` so W0 has a `WAVE_BASE` and a clean tree. No-op once a wave exists (mid-campaign dirt stays W0's to judge). Keep `head` / `files` for I4 and the final report. Exit 1 → abort, like an I2 miss. The committed `.homegraph/` rule stays load-bearing: `ensure_index.ts` refuses to write an index whose database would be tracked, and amends an existing `.gitignore` instead of committing a db — do not remove it.
|
|
97
|
-
10. **Seed the semantic-docs baseline once** (
|
|
97
|
+
10. **Seed the semantic-docs baseline once** (sub-agent invoking `a2h-module-semantic-docs`, the same single path B5 uses; require the docs-refresh reply contract in SKILL.md I5), then commit the result as `semantic-docs baseline` (orchestrator). Run it when either `.hometrans/module_understanding/.module_semantic_docs_state.json` or `project_design.md` is missing; skip only when both exist. If `project_design.md` is absent and the seed fails — reply `ok:false`, an unparseable reply, or `project_design.md` still absent or empty after the sub-agent returns — **stop the run**: the B1 design step has no `project_design.md` to read and every spec would fail — report the failure. When `project_design.md` already exists, a skipped or failed seed is not fatal; proceed.
|
|
98
98
|
10b. **Campaign identity.** If `state.config.campaign_id` is absent, generate one and persist it with the state write: `node -e "process.stdout.write(crypto.randomUUID())"`. A resume keeps the existing value — it identifies this campaign, not this process. This nonce (never `specs_json_sha256`, which is identical when the same specs.json starts a new campaign) is the `runId` the Homecheck gate dispatch carries.
|
|
99
99
|
|
|
100
100
|
### I4 — Announce, then commit to autonomous execution
|
|
@@ -6,7 +6,7 @@ Authoritative post-loop procedure, applied verbatim (SKILL.md → After the wave
|
|
|
6
6
|
|
|
7
7
|
**Finalization is gated on this step.** `state.post_homecheck` must exist before Finalization. Missing → run this gate (or write the I2 8b `skipped` mirror, per `references/state-and-resume.md`), then the smoke gate.
|
|
8
8
|
|
|
9
|
-
Dispatch one foreground `general` sub-agent to run the gate verbatim per `references/static-defect-gate.md` (that file owns the inputs, the nonce rule, gate mode, warning policy, fail-soft rules and the reply contract; pass `runId = state.config.campaign_id`). Validate its reply per
|
|
9
|
+
Dispatch one foreground `general` sub-agent to run the gate verbatim per `references/static-defect-gate.md` (that file owns the inputs, the nonce rule, gate mode, warning policy, fail-soft rules and the reply contract; pass `runId = state.config.campaign_id`). Validate its reply per **its own** contract (`summary.json` fallback only on a `runId` match; the gate is idempotent and does **not** use `references/reply-recovery.md`), mirror it into `state.post_homecheck` (the resume authority); reply `build: FAILED` → write the reply-recovery baseline (`node <skill-dir>/scripts/settle.ts <HMOS> --init --stage homecheck-build --wave <K> --dispatch-at <DISPATCH_AT> --output <HMOS>/.hometrans/homecheck/build --pre-head <PRE_HEAD>`; `K` = the last wave — post-loop is not reached on a carried-only run) and dispatch one `build-fixer` (B3's contract, the same `output_path`), validating its reply as in B3 (`references/reply-recovery.md`, probe with `--stage homecheck-build --wave <K>`). `settled_empty` runs the inline build; `settled_timeout` **stops for manual recovery** and the smoke gate is not run. Then the smoke gate on the fresh build.
|
|
10
10
|
|
|
11
11
|
## Runtime smoke gate (after Homecheck, before Finalization)
|
|
12
12
|
|
|
@@ -19,5 +19,5 @@ Run `a2h-coldstart-smoke-gate` yourself (no sub-agent) with `harmony_project_dir
|
|
|
19
19
|
2. Design issue sweep: list `DESIGN_DIR/SPEC_DESIGN_G*_c*_issue.md` files for manual follow-up.
|
|
20
20
|
3. Run `node <skill-dir>/scripts/check_design_map.ts <HMOS>`; exit 1 → list its problems in the report, never call the map complete.
|
|
21
21
|
3b. **Ledger finalization**: snapshot `<HMOS>/.hometrans/dispatch/ledger.jsonl` to `dispatch/ledger.final-<ts>.jsonl` (the summary report lists its unresolved/accepted units), then write `<HMOS>/.hometrans/dispatch/waker.stop` (idempotent — the waker was already stopped at the last wave's barrier) and `reconcile` once for the final count. Never delete the ledger; never leave a background waker alive after the run ends.
|
|
22
|
-
4. Print the summary report per `references/final-report-template.md` (every section mandatory; all outcomes — including failures — carried, never silently dropped).
|
|
22
|
+
4. Print the summary report per `references/final-report-template.md` (every section mandatory; all outcomes — including failures — carried, never silently dropped). Before printing, re-verify every review-open item (open FAIL / PARTIAL scenarios, open cross-cutting findings) against the merged trunk per the template's re-verification rule — a wave-1 group's final verdict predates later waves' merges, so an open item may already be closed by a later group's code; resolved items are reported as resolved (symbol + file:line), never as current follow-ups.
|
|
23
23
|
5. Write `state.finalization = { done: true, final_build, homecheck: <post_homecheck.status>, smoke: <post_smoke.verdict>, at }` (atomic) — the completion marker callers check; absent = Finalization never ran. Flags without on-disk evidence are not done (state-and-resume.md → Completion evidence).
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
# Reply recovery — host-independent, no session resume
|
|
2
|
+
|
|
3
|
+
Apply this file to every **foreground stage** dispatch: F0
|
|
4
|
+
(`references/shared-layer.md`), B3 (`SKILL.md` → B3), the B4 round rebuild
|
|
5
|
+
(`references/review-loop.md`), the build breaker (`references/coding-loop.md`),
|
|
6
|
+
and the post-Homecheck build-fixer (`references/post-loop.md`). **Not the
|
|
7
|
+
Homecheck gate itself**: that agent is idempotent and owns a `summary.json` +
|
|
8
|
+
`runId` fallback (`references/post-loop.md`). Background chunk and resolver
|
|
9
|
+
dispatches are covered by the dispatch ledger, not this file.
|
|
10
|
+
|
|
11
|
+
Stages: `f0`, `b3`, `b4-rebuild`, `build-breaker`, `homecheck-build`
|
|
12
|
+
(`review-rebuild` is normalized to `b4-rebuild`; the baseline filename uses the
|
|
13
|
+
normalized stage).
|
|
14
|
+
|
|
15
|
+
## Why
|
|
16
|
+
|
|
17
|
+
A foreground sub-agent call returns at the agent's **first idle**. A
|
|
18
|
+
prose/status-line reply ("will resume when the background task finishes"),
|
|
19
|
+
prose, or a truncated object means it went idle
|
|
20
|
+
mid-run and may still be writing `<HMOS>` — typically behind its own background
|
|
21
|
+
build. Two rules are absolute:
|
|
22
|
+
|
|
23
|
+
- **Never dispatch a second agent of the same kind beside it.** Two writers on
|
|
24
|
+
the main tree, or two `devecocli build` runs sharing the hvigor daemon and
|
|
25
|
+
the same `output_path`, are a corruption source, not a retry.
|
|
26
|
+
- **Never resume a session.** Some hosts cannot; recovery must be identical on
|
|
27
|
+
every host. Disk evidence is the only contract.
|
|
28
|
+
|
|
29
|
+
Absence of change is **not** completion. A cold `devecocli build` is quiet for
|
|
30
|
+
minutes (`agents/build-fixer.md`: a cold first build can take a few minutes),
|
|
31
|
+
a missing artifact has no mtime, and a pre-dispatch file must not make the tree
|
|
32
|
+
look settled. Freshness is anchored at the dispatch instant, never at
|
|
33
|
+
"whatever happened to be on disk".
|
|
34
|
+
|
|
35
|
+
## Constants
|
|
36
|
+
|
|
37
|
+
| knob | value | why |
|
|
38
|
+
|---|---|---|
|
|
39
|
+
| `POLL_MS` | 15000 | cheap; the probe must not be the resolution limit |
|
|
40
|
+
| `QUIET_MS` | 660000 (all stages) | F0 may run a cold `devecocli docs` index and build stages a 600000 ms build; the quiet window must exceed the longest silent work with margin |
|
|
41
|
+
| `SLICE_MS` | 300000 per call | a slice ≤ the host's per-call cap; the probe returns `pending` at the boundary and the caller re-runs it |
|
|
42
|
+
| `WAIT_MS` | 1800000 total | the stage's whole recovery budget; `--max-ms` is an alias (never pass both) |
|
|
43
|
+
| `SCAN_BUDGET` (`--scan-budget`) | 200000 entries per activity root | a truncated scan is fail-closed: it can never produce `settled_empty`; a dirty list above the same cap is fail-closed too |
|
|
44
|
+
|
|
45
|
+
`DISPATCH_AT` = the instant the stage agent was dispatched (ISO). The baseline
|
|
46
|
+
records it before the call; every freshness check is relative to it, so a
|
|
47
|
+
stale manifest/report from an earlier attempt can never be this round's result.
|
|
48
|
+
|
|
49
|
+
A root that exceeds `SCAN_BUDGET` on every sample is fail-closed: it can end in
|
|
50
|
+
`settled_timeout` (manual stop), never `settled_empty`. Raise `--scan-budget`
|
|
51
|
+
or accept the stop; never weaken the evidence bar to make it quiet.
|
|
52
|
+
|
|
53
|
+
## Steps
|
|
54
|
+
|
|
55
|
+
0. **Before the dispatch**, after recording `PRE_HEAD = git rev-parse HEAD`,
|
|
56
|
+
write the baseline (the script's only write):
|
|
57
|
+
`node <skill-dir>/scripts/settle.ts <HMOS> --init --stage <stage> --wave <K>
|
|
58
|
+
--dispatch-at <DISPATCH_AT> [--output <abs output_path>]
|
|
59
|
+
[--campaign-id <id>] [--base <PRE_F0>] [--pre-head <PRE_HEAD>] [--force]`
|
|
60
|
+
It stores `dispatch_at`, `pre_head`, `campaign_id`, `base`, `stage`,
|
|
61
|
+
`wave`, `output`, `targets` and each target's `{mtime,size}` (or `absent`)
|
|
62
|
+
in `<HMOS>/.hometrans/wave_<K>/reply_recovery_<stage>.json` (one baseline
|
|
63
|
+
per stage; `--baseline` overrides the path). F0 **requires**
|
|
64
|
+
`--campaign-id` and `--base`; a fresh F0 baseline without them is refused.
|
|
65
|
+
`--init` refuses to overwrite an existing baseline unless `--force` is
|
|
66
|
+
passed — use `--force` only after confirming the old agent is gone.
|
|
67
|
+
`--output` is required
|
|
68
|
+
for every stage except F0; F0's target is
|
|
69
|
+
`<HMOS>/.hometrans/wave_<K>/shared_manifest.json`, the build stages' are
|
|
70
|
+
`<output_path>/build-fix-report.md` + `<output_path>/build-fix-commit-info.md`.
|
|
71
|
+
Use absolute paths (relative `--baseline`/`--artifact` resolve under
|
|
72
|
+
`<HMOS>/.hometrans`).
|
|
73
|
+
1. A **parseable** reply goes to the stage's normal validation. The reply
|
|
74
|
+
itself is the evidence; the freshness gate below is for the disk fallback.
|
|
75
|
+
2. An **unparseable** reply → run the read-only probe in slices inside this
|
|
76
|
+
turn, until it returns a terminal verdict:
|
|
77
|
+
`node <skill-dir>/scripts/settle.ts <HMOS> --stage <stage> --wave <K>`
|
|
78
|
+
(or `--baseline <HMOS>/.hometrans/wave_<K>/reply_recovery_<stage>.json`).
|
|
79
|
+
The baseline supplies `dispatch_at`, `targets`, `campaign_id`, `base` and
|
|
80
|
+
`pre_head`; nothing needs to be repeated. **`b4-rebuild` is the exception:
|
|
81
|
+
it must pass its round-specific `--baseline` every time** (the default
|
|
82
|
+
`--stage --wave` path cannot identify the review round; the script rejects
|
|
83
|
+
it). Each
|
|
84
|
+
call runs for up to `SLICE_MS` and returns `pending` at the boundary —
|
|
85
|
+
re-run it until `artifact_fresh` / `settled_empty` / `settled_timeout`.
|
|
86
|
+
Do **not** pass `--once` in production: it returns after one sample and
|
|
87
|
+
defeats the slice (it exists for tests/debugging). Set the host shell
|
|
88
|
+
timeout to at least `SLICE_MS` + a margin. Exit 0 is only
|
|
89
|
+
`artifact_fresh`; `3` is anything else; `2` is usage/unreadable baseline.
|
|
90
|
+
**The probe never redefines evidence.** `--artifact`, `--dispatch-at`,
|
|
91
|
+
`--campaign-id`, `--base` and `--pre-head` must match the baseline (or be
|
|
92
|
+
omitted); an `--artifact` list must be a superset of the baseline targets.
|
|
93
|
+
Only `--init` sets them.
|
|
94
|
+
3. **Only `artifact_fresh` ends the recovery.** Fresh = every target exists,
|
|
95
|
+
`mtime > DISPATCH_AT`, `mtime <= now + 60s` (a future mtime is
|
|
96
|
+
`invalid:future-mtime`), differs from the baseline, and the stage's
|
|
97
|
+
ownership check passes:
|
|
98
|
+
- F0: `manifest.campaign_id` and `manifest.base` must both be present in the
|
|
99
|
+
baseline and match (`ownership-unchecked` is `invalid`, never fresh);
|
|
100
|
+
- build stages: a report **line/list item/table cell** carries `Build Status`
|
|
101
|
+
(markdown emphasis such as `**Build Status**: SUCCESS` and table forms are
|
|
102
|
+
accepted; prose that merely mentions it is not), and the
|
|
103
|
+
commit-info is `commit_id: none` **only while `HEAD == PRE_HEAD` and the
|
|
104
|
+
tree is clean** (`none-but-head-moved`, `none-but-dirty-tree`), or a real
|
|
105
|
+
commit that resolves to a full OID (`resolveOid` compares OIDs, so a
|
|
106
|
+
short/uppercase sha of `PRE_HEAD` cannot pass as a new commit), differs
|
|
107
|
+
from `PRE_HEAD` (`not-a-new-commit`), passes
|
|
108
|
+
`git merge-base --is-ancestor PRE_HEAD <commit>`, and is reachable from
|
|
109
|
+
the current `HEAD` (`git merge-base --is-ancestor <commit> HEAD`;
|
|
110
|
+
`commit-not-on-head`).
|
|
111
|
+
Then validate as the stage normally does (F0:
|
|
112
|
+
`validate_shared_manifest.ts` + status branch; B3: the report +
|
|
113
|
+
`ensure_index.ts --sync` under `b3-fix`).
|
|
114
|
+
4. `settled_empty` — the tree has been quiet for `QUIET_MS` with no fresh
|
|
115
|
+
artifact. An artifact reported `invalid` (wrong campaign/base, unreadable
|
|
116
|
+
manifest, empty report, missing/non-descendant commit) is a failed
|
|
117
|
+
recovery, never fresh. Apply the stage's existing fail-soft:
|
|
118
|
+
- F0: `HEAD == PRE_F0` and the tree clean → write a skipped manifest
|
|
119
|
+
`reason:"failed:settle_empty"`, restore the wiring snapshot, continue to
|
|
120
|
+
W0 (nothing to roll back). `HEAD != PRE_F0` with no validated manifest →
|
|
121
|
+
the existing **unowned-history anomaly**: record
|
|
122
|
+
`failed:post_agent_commit`, restore the snapshot, **stop for manual
|
|
123
|
+
recovery, never reset or delete those commits**. A dirty tree → the W0
|
|
124
|
+
dirty-tree rule stops the run.
|
|
125
|
+
- build stages: run the stage's existing inline build once, in the
|
|
126
|
+
foreground (B3 step 3; `600000 ms` timeout) and record its outcome.
|
|
127
|
+
`660000 ms` of quiet covers one full build timeout; a live fixer that is
|
|
128
|
+
between builds writes again, and a truncated scan is fail-closed — the
|
|
129
|
+
ladder does not claim to observe the process itself. A deleted tracked
|
|
130
|
+
path counts as activity; `git status` uses `-uall` so a file rewritten
|
|
131
|
+
inside a new untracked directory is visible (a directory mtime does not
|
|
132
|
+
change on in-place file rewrites).
|
|
133
|
+
5. `settled_timeout` — activity continued to `WAIT_MS` without going quiet. A
|
|
134
|
+
live writer may still own the main tree: **stop for manual recovery**. Do
|
|
135
|
+
not reset, clean, continue W0, continue B4–C, or run an inline build. For a
|
|
136
|
+
build stage record `build: "FAILED"` with
|
|
137
|
+
`note: "reply-recovery: settled_timeout"` first; `C`'s `git add -A` must
|
|
138
|
+
never run on a tree a live agent may still be writing.
|
|
139
|
+
6. Record `reply_recovery: {verdict, polls, waitedMs, lastActivityAt, head,
|
|
140
|
+
statusKnown, statusError, activityTruncated, clockSkew, dirty, artifacts}`
|
|
141
|
+
in the wave log and the final report
|
|
142
|
+
(`references/final-report-template.md`, `Reply recovery:` line). The
|
|
143
|
+
`settle.ts` output is the source; never self-assess.
|
|
144
|
+
7. The reset helper still runs only after the last sub-agent call has
|
|
145
|
+
returned — this ladder **never widens the two recorded rollback cases**
|
|
146
|
+
(`references/shared-layer.md` → Ownership-guarded rollback).
|
|
147
|
+
|
|
148
|
+
## Missing or old baseline
|
|
149
|
+
|
|
150
|
+
A probe without a readable baseline exits 2. Do **not** run `--init` again
|
|
151
|
+
while a live agent may still exist (it would move `DISPATCH_AT` past that
|
|
152
|
+
agent's output; `--init` refuses to overwrite without `--force`). Use the
|
|
153
|
+
stage's existing on-disk fallback or stop for manual recovery and say so in
|
|
154
|
+
the final report. On a genuine resume (the agent is gone), a fresh `--init
|
|
155
|
+
--force` is the correct new dispatch baseline.
|
|
156
|
+
|
|
157
|
+
If a stage runs more than once in the same wave (B4 review rounds, a B3
|
|
158
|
+
retry), give each attempt its own baseline path — e.g.
|
|
159
|
+
`wave_<K>/review_round_<r>/reply_recovery_b4-rebuild.json` — rather than
|
|
160
|
+
overwriting the previous round's evidence. A caller that re-dispatches the
|
|
161
|
+
same stage/wave without a distinct path must pass `--force` after confirming
|
|
162
|
+
the old agent is gone.
|
|
163
|
+
|
|
164
|
+
## Scope of the "no foreground wait" rule
|
|
165
|
+
|
|
166
|
+
`references/coding-loop.md` forbids sitting in a foreground wait/sleep **while
|
|
167
|
+
a ledger unit is active** — a blocked turn cannot receive its completion
|
|
168
|
+
notification. This ladder is not that case: F0 runs before `init` (no ledger
|
|
169
|
+
unit), and B3 / B4 rebuild / breaker / post-gate fixer run after the wave
|
|
170
|
+
barrier with `dispatch/waker.stop` already written (no active unit). Under
|
|
171
|
+
`WAIT_MODE=foreground` blocking is the only legal shape. Keep each call within
|
|
172
|
+
`SLICE_MS` so a nested node agent never looks stalled to its caller.
|
|
@@ -67,5 +67,5 @@ Loop rounds `r = 1 .. MAX_ROUNDS_REVIEW` (default `2`):
|
|
|
67
67
|
|
|
68
68
|
A fixer that errors → retry it once; a second failure → record it, the group stays open, and the next fixer is dispatched.
|
|
69
69
|
|
|
70
|
-
When every fixer has returned, dispatch **one** `build-fixer` (B3's fields, `output_path: <HMOS>/.hometrans/wave_<K>/review_round_<r>/build`) and validate its reply exactly as in B3. Its fix commit, when any, counts as a previous-round commit for step 1(c). After that round rebuild, run `node <skill-dir>/scripts/ensure_index.ts <HMOS> --sync` (trigger `b4-rebuild`; skip when `ENGINE_MODE=off`; record the JSON line). Then the next round.
|
|
71
|
-
6. **Last round.** After `r = MAX_ROUNDS_REVIEW`'s fixes, re-review the fixed groups once (step 1–3 rules, `review-round_<r+1>`, no fixer); that verdict is final. Groups still open are listed in the final report with their open scenarios and last `review-fix-report.md` as manual follow-up.
|
|
70
|
+
When every fixer has returned, write the reply-recovery baseline for **this round** (`node <skill-dir>/scripts/settle.ts <HMOS> --init --stage b4-rebuild --wave <K> --dispatch-at <DISPATCH_AT> --output <HMOS>/.hometrans/wave_<K>/review_round_<r>/build --pre-head <PRE_HEAD> --baseline <HMOS>/.hometrans/wave_<K>/review_round_<r>/reply_recovery_b4-rebuild.json`), then dispatch **one** `build-fixer` (B3's fields, `output_path: <HMOS>/.hometrans/wave_<K>/review_round_<r>/build`) and validate its reply exactly as in B3 using the same `--baseline` (`references/reply-recovery.md`; `settled_empty` runs the inline build, `settled_timeout` stops for manual recovery and never starts the next round). Its fix commit, when any, counts as a previous-round commit for step 1(c). After that round rebuild, run `node <skill-dir>/scripts/ensure_index.ts <HMOS> --sync` (trigger `b4-rebuild`; skip when `ENGINE_MODE=off`; record the JSON line). Then the next round.
|
|
71
|
+
6. **Last round.** After `r = MAX_ROUNDS_REVIEW`'s fixes, re-review the fixed groups once (step 1–3 rules, `review-round_<r+1>`, no fixer); that verdict is final. Groups still open are listed in the final report with their open scenarios and last `review-fix-report.md` as manual follow-up. That verdict is a **review-time snapshot**, not a terminal state: for an early-wave group it was judged before later waves merged, and a later group may have already closed an open item (e.g. the cross-group data layer a fixer could not build). The verdict recorded in state is never rewritten here — at Finalization every open item is re-verified against the merged trunk before it enters the report (rule in `references/final-report-template.md`); items a later wave resolved are reported as resolved there, not as manual follow-up.
|