@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,593 @@
|
|
|
1
|
+
// Tests for settle.ts — the host-independent reply-recovery evidence gate.
|
|
2
|
+
// Core contract: absence of change is NEVER completion; a fresh artifact
|
|
3
|
+
// (newer than dispatch_at, different from the baseline, owned by this
|
|
4
|
+
// campaign/commit) is the only positive verdict. A pre-dispatch file must
|
|
5
|
+
// not make the probe look "quiet"; a tracked modification must be seen even
|
|
6
|
+
// though `git status --porcelain` starts with a leading space.
|
|
7
|
+
import { spawnSync } from 'node:child_process';
|
|
8
|
+
import { mkdirSync, mkdtempSync, readFileSync, rmSync, utimesSync, writeFileSync } from 'node:fs';
|
|
9
|
+
import * as os from 'node:os';
|
|
10
|
+
import * as path from 'node:path';
|
|
11
|
+
import { fileURLToPath } from 'node:url';
|
|
12
|
+
import { test, type TestContext } from 'node:test';
|
|
13
|
+
import assert from 'node:assert/strict';
|
|
14
|
+
|
|
15
|
+
const HERE = path.dirname(fileURLToPath(import.meta.url));
|
|
16
|
+
const SCRIPT = path.join(HERE, 'settle.ts');
|
|
17
|
+
const T0 = Date.now() - 600_000; // dispatch (10m ago)
|
|
18
|
+
const NOW = Date.now() + 600_000; // settle sample (10m after the baseline write)
|
|
19
|
+
const iso = (ms: number) => new Date(ms).toISOString();
|
|
20
|
+
|
|
21
|
+
interface Fx { tmp: string; hmos: string; ht: string; wave: string; }
|
|
22
|
+
|
|
23
|
+
function gitOut(fx: Fx, ...args: string[]): string {
|
|
24
|
+
const r = spawnSync('git', ['-C', fx.hmos, ...args], { encoding: 'utf8' });
|
|
25
|
+
assert.equal(r.status, 0, r.stderr);
|
|
26
|
+
return (r.stdout ?? '').trim();
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
function makeFx(t: TestContext): Fx {
|
|
30
|
+
const tmp = mkdtempSync(path.join(os.tmpdir(), 'settle-'));
|
|
31
|
+
t.after(() => rmSync(tmp, { recursive: true, force: true }));
|
|
32
|
+
const hmos = path.join(tmp, 'hmos');
|
|
33
|
+
const ht = path.join(hmos, '.hometrans');
|
|
34
|
+
const wave = path.join(ht, 'wave_1');
|
|
35
|
+
mkdirSync(wave, { recursive: true });
|
|
36
|
+
writeFileSync(path.join(hmos, '.gitignore'), '.hometrans/\n', 'utf8');
|
|
37
|
+
writeFileSync(path.join(hmos, 'src.txt'), 'base\n', 'utf8');
|
|
38
|
+
const g = (...args: string[]) => spawnSync('git', ['-C', hmos, ...args], { encoding: 'utf8' });
|
|
39
|
+
g('init', '-q');
|
|
40
|
+
g('config', 'user.name', 'test');
|
|
41
|
+
g('config', 'user.email', 'test@example.com');
|
|
42
|
+
g('add', '.gitignore', 'src.txt');
|
|
43
|
+
g('commit', '-q', '-m', 'init');
|
|
44
|
+
return { tmp, hmos, ht, wave };
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
function writeAt(file: string, ms: number, content = 'x'): void {
|
|
48
|
+
mkdirSync(path.dirname(file), { recursive: true });
|
|
49
|
+
writeFileSync(file, content, 'utf8');
|
|
50
|
+
utimesSync(file, new Date(ms), new Date(ms));
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
function run(fx: Fx, ...args: string[]) {
|
|
54
|
+
return spawnSync(process.execPath, [SCRIPT, fx.hmos, ...args],
|
|
55
|
+
{ encoding: 'utf8', timeout: 120_000 });
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
function initF0(fx: Fx): string {
|
|
59
|
+
const pre = gitOut(fx, 'rev-parse', 'HEAD');
|
|
60
|
+
const r = run(fx, '--stage', 'f0', '--wave', '1', '--dispatch-at', iso(T0),
|
|
61
|
+
'--campaign-id', 'C', '--base', pre, '--init');
|
|
62
|
+
assert.equal(r.status, 0, r.stderr);
|
|
63
|
+
return pre;
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
function settleF0(fx: Fx, extra: string[] = []) {
|
|
67
|
+
return run(fx, '--stage', 'f0', '--wave', '1', '--once', '--now', iso(NOW), ...extra);
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
function initB3(fx: Fx, pre: string): string {
|
|
71
|
+
const outDir = path.join(fx.wave, 'build');
|
|
72
|
+
const r = run(fx, '--stage', 'b3', '--wave', '1', '--dispatch-at', iso(T0),
|
|
73
|
+
'--output', outDir, '--pre-head', pre, '--init');
|
|
74
|
+
assert.equal(r.status, 0, r.stderr);
|
|
75
|
+
return outDir;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
function settleB3(fx: Fx, outDir: string) {
|
|
79
|
+
return run(fx, '--stage', 'b3', '--wave', '1', '--output', outDir,
|
|
80
|
+
'--once', '--now', iso(NOW));
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
test('init records dispatch_at, pre_head, campaign/base and the artifact baseline', (t) => {
|
|
84
|
+
const fx = makeFx(t);
|
|
85
|
+
const pre = initF0(fx);
|
|
86
|
+
const b = JSON.parse(readFileSync(path.join(fx.wave, 'reply_recovery_f0.json'), 'utf8'));
|
|
87
|
+
assert.equal(b.schema, 'spec_reply_recovery/v2');
|
|
88
|
+
assert.equal(b.dispatch_at, iso(T0));
|
|
89
|
+
assert.equal(b.pre_head, pre);
|
|
90
|
+
assert.equal(b.campaign_id, 'C');
|
|
91
|
+
assert.equal(b.base, pre);
|
|
92
|
+
assert.deepEqual(b.targets, [path.join(fx.wave, 'shared_manifest.json')]);
|
|
93
|
+
assert.equal(b.artifacts[0].state, 'absent');
|
|
94
|
+
});
|
|
95
|
+
|
|
96
|
+
test('a missing artifact is settled_empty, never artifact_fresh', (t) => {
|
|
97
|
+
const fx = makeFx(t);
|
|
98
|
+
initF0(fx);
|
|
99
|
+
const r = settleF0(fx);
|
|
100
|
+
assert.equal(r.status, 3, `${r.stderr}${r.stdout}`);
|
|
101
|
+
const out = JSON.parse(r.stdout as string);
|
|
102
|
+
assert.equal(out.verdict, 'settled_empty');
|
|
103
|
+
assert.equal(out.quietMs, 660_000);
|
|
104
|
+
assert.equal(out.artifacts[0].state, 'absent');
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
test('a pre-dispatch file does not make the probe look quiet', (t) => {
|
|
108
|
+
const fx = makeFx(t);
|
|
109
|
+
writeAt(path.join(fx.wave, 'old.log'), T0 - 3_600_000);
|
|
110
|
+
initF0(fx);
|
|
111
|
+
const r = run(fx, '--stage', 'f0', '--wave', '1', '--once', '--now', iso(T0 + 10_000));
|
|
112
|
+
assert.equal(r.status, 3, `${r.stderr}${r.stdout}`);
|
|
113
|
+
assert.equal(JSON.parse(r.stdout as string).verdict, 'pending');
|
|
114
|
+
});
|
|
115
|
+
|
|
116
|
+
test('a tracked modification is seen despite the leading status space', (t) => {
|
|
117
|
+
const fx = makeFx(t);
|
|
118
|
+
initF0(fx);
|
|
119
|
+
writeFileSync(path.join(fx.hmos, 'src.txt'), 'changed\n', 'utf8');
|
|
120
|
+
utimesSync(path.join(fx.hmos, 'src.txt'), new Date(NOW - 30_000), new Date(NOW - 30_000));
|
|
121
|
+
const r = settleF0(fx);
|
|
122
|
+
assert.equal(r.status, 3, `${r.stderr}${r.stdout}`);
|
|
123
|
+
const out = JSON.parse(r.stdout as string);
|
|
124
|
+
assert.equal(out.verdict, 'pending');
|
|
125
|
+
assert.ok(out.dirty.includes('src.txt'), JSON.stringify(out.dirty));
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
test('an artifact older than dispatch_at is stale, not fresh', (t) => {
|
|
129
|
+
const fx = makeFx(t);
|
|
130
|
+
const manifest = path.join(fx.wave, 'shared_manifest.json');
|
|
131
|
+
writeAt(manifest, T0 - 60_000, JSON.stringify({ campaign_id: 'C', base: 'x' }));
|
|
132
|
+
initF0(fx);
|
|
133
|
+
const r = settleF0(fx);
|
|
134
|
+
assert.equal(r.status, 3, `${r.stderr}${r.stdout}`);
|
|
135
|
+
const out = JSON.parse(r.stdout as string);
|
|
136
|
+
assert.notEqual(out.verdict, 'artifact_fresh');
|
|
137
|
+
assert.equal(out.artifacts[0].state, 'stale');
|
|
138
|
+
});
|
|
139
|
+
|
|
140
|
+
test('a fresh manifest ends the recovery using the baseline ownership fields', (t) => {
|
|
141
|
+
const fx = makeFx(t);
|
|
142
|
+
const pre = initF0(fx);
|
|
143
|
+
writeAt(path.join(fx.wave, 'shared_manifest.json'), T0 + 1_000,
|
|
144
|
+
JSON.stringify({ campaign_id: 'C', base: pre }));
|
|
145
|
+
const r = settleF0(fx);
|
|
146
|
+
assert.equal(r.status, 0, `${r.stderr}${r.stdout}`);
|
|
147
|
+
const out = JSON.parse(r.stdout as string);
|
|
148
|
+
assert.equal(out.verdict, 'artifact_fresh');
|
|
149
|
+
assert.equal(out.artifacts[0].state, 'fresh');
|
|
150
|
+
});
|
|
151
|
+
|
|
152
|
+
test('a manifest from another campaign is invalid, never fresh', (t) => {
|
|
153
|
+
const fx = makeFx(t);
|
|
154
|
+
initF0(fx);
|
|
155
|
+
writeAt(path.join(fx.wave, 'shared_manifest.json'), T0 + 1_000,
|
|
156
|
+
JSON.stringify({ campaign_id: 'OTHER', base: 'x' }));
|
|
157
|
+
const r = settleF0(fx);
|
|
158
|
+
assert.equal(r.status, 3, `${r.stderr}${r.stdout}`);
|
|
159
|
+
const out = JSON.parse(r.stdout as string);
|
|
160
|
+
assert.equal(out.verdict, 'settled_empty');
|
|
161
|
+
assert.equal(out.artifacts[0].state, 'invalid');
|
|
162
|
+
});
|
|
163
|
+
|
|
164
|
+
test('activity under an ignored root keeps the verdict pending', (t) => {
|
|
165
|
+
const fx = makeFx(t);
|
|
166
|
+
initF0(fx);
|
|
167
|
+
writeAt(path.join(fx.wave, 'build_attempt_1.log'), NOW - 30_000);
|
|
168
|
+
const r = settleF0(fx);
|
|
169
|
+
assert.equal(r.status, 3, `${r.stderr}${r.stdout}`);
|
|
170
|
+
assert.equal(JSON.parse(r.stdout as string).verdict, 'pending');
|
|
171
|
+
});
|
|
172
|
+
|
|
173
|
+
test('activity through the whole wait budget is settled_timeout', (t) => {
|
|
174
|
+
const fx = makeFx(t);
|
|
175
|
+
initF0(fx);
|
|
176
|
+
writeAt(path.join(fx.wave, 'build_attempt_1.log'), NOW - 30_000);
|
|
177
|
+
const r = settleF0(fx, ['--wait-ms', '300000']);
|
|
178
|
+
assert.equal(r.status, 3, `${r.stderr}${r.stdout}`);
|
|
179
|
+
assert.equal(JSON.parse(r.stdout as string).verdict, 'settled_timeout');
|
|
180
|
+
});
|
|
181
|
+
|
|
182
|
+
test('b3: commit_id none is fresh only while HEAD is still pre_head', (t) => {
|
|
183
|
+
const fx = makeFx(t);
|
|
184
|
+
const a = gitOut(fx, 'rev-parse', 'HEAD');
|
|
185
|
+
const outDir = initB3(fx, a);
|
|
186
|
+
writeAt(path.join(outDir, 'build-fix-report.md'), T0 + 1_000, 'Build Status: SUCCESS\n');
|
|
187
|
+
writeAt(path.join(outDir, 'build-fix-commit-info.md'), T0 + 1_000, 'commit_id: none\n');
|
|
188
|
+
const ok = settleB3(fx, outDir);
|
|
189
|
+
assert.equal(ok.status, 0, `${ok.stderr}${ok.stdout}`);
|
|
190
|
+
assert.equal(JSON.parse(ok.stdout as string).verdict, 'artifact_fresh');
|
|
191
|
+
|
|
192
|
+
gitOut(fx, 'commit', '--allow-empty', '-q', '-m', 'moved');
|
|
193
|
+
writeAt(path.join(outDir, 'build-fix-commit-info.md'), T0 + 2_000, 'commit_id: none\n');
|
|
194
|
+
const bad = settleB3(fx, outDir);
|
|
195
|
+
assert.equal(bad.status, 3, `${bad.stderr}${bad.stdout}`);
|
|
196
|
+
assert.equal(JSON.parse(bad.stdout as string).artifacts[1]!.state, 'invalid');
|
|
197
|
+
});
|
|
198
|
+
|
|
199
|
+
test('b3: commit == pre_head is not a new fix commit', (t) => {
|
|
200
|
+
const fx = makeFx(t);
|
|
201
|
+
const a = gitOut(fx, 'rev-parse', 'HEAD');
|
|
202
|
+
const outDir = initB3(fx, a);
|
|
203
|
+
writeAt(path.join(outDir, 'build-fix-report.md'), T0 + 1_000, 'Build Status: SUCCESS\n');
|
|
204
|
+
writeAt(path.join(outDir, 'build-fix-commit-info.md'), T0 + 1_000, `commit_id: ${a}\n`);
|
|
205
|
+
const r = settleB3(fx, outDir);
|
|
206
|
+
assert.equal(r.status, 3, `${r.stderr}${r.stdout}`);
|
|
207
|
+
assert.equal(JSON.parse(r.stdout as string).artifacts[1]!.state, 'invalid');
|
|
208
|
+
});
|
|
209
|
+
|
|
210
|
+
test('b3: a real fix commit descended from pre_head ends the recovery', (t) => {
|
|
211
|
+
const fx = makeFx(t);
|
|
212
|
+
const a = gitOut(fx, 'rev-parse', 'HEAD');
|
|
213
|
+
const outDir = initB3(fx, a);
|
|
214
|
+
writeFileSync(path.join(fx.hmos, 'src.txt'), 'fixed\n', 'utf8');
|
|
215
|
+
gitOut(fx, 'add', 'src.txt');
|
|
216
|
+
gitOut(fx, 'commit', '-q', '-m', 'fix(build): fix 1 compilation error');
|
|
217
|
+
const b = gitOut(fx, 'rev-parse', 'HEAD');
|
|
218
|
+
writeAt(path.join(outDir, 'build-fix-report.md'), T0 + 1_000, 'Build Status: SUCCESS\n');
|
|
219
|
+
writeAt(path.join(outDir, 'build-fix-commit-info.md'), T0 + 1_000, `commit_id: ${b}\n`);
|
|
220
|
+
const r = settleB3(fx, outDir);
|
|
221
|
+
assert.equal(r.status, 0, `${r.stderr}${r.stdout}`);
|
|
222
|
+
assert.equal(JSON.parse(r.stdout as string).verdict, 'artifact_fresh');
|
|
223
|
+
});
|
|
224
|
+
|
|
225
|
+
test('b3: an empty report is invalid even with a valid commit', (t) => {
|
|
226
|
+
const fx = makeFx(t);
|
|
227
|
+
const a = gitOut(fx, 'rev-parse', 'HEAD');
|
|
228
|
+
const outDir = initB3(fx, a);
|
|
229
|
+
writeAt(path.join(outDir, 'build-fix-report.md'), T0 + 1_000, 'hello\n');
|
|
230
|
+
writeAt(path.join(outDir, 'build-fix-commit-info.md'), T0 + 1_000, 'commit_id: none\n');
|
|
231
|
+
const r = settleB3(fx, outDir);
|
|
232
|
+
assert.equal(r.status, 3, `${r.stderr}${r.stdout}`);
|
|
233
|
+
assert.equal(JSON.parse(r.stdout as string).artifacts[0]!.state, 'invalid');
|
|
234
|
+
});
|
|
235
|
+
|
|
236
|
+
test('a commit after dispatch counts once, then the probe can go quiet', (t) => {
|
|
237
|
+
const fx = makeFx(t);
|
|
238
|
+
initF0(fx);
|
|
239
|
+
gitOut(fx, 'commit', '--allow-empty', '-q', '-m', 'later');
|
|
240
|
+
const later = Date.now() + 1_800_000;
|
|
241
|
+
const r = run(fx, '--stage', 'f0', '--wave', '1', '--once', '--now', iso(later));
|
|
242
|
+
assert.equal(r.status, 3, `${r.stderr}${r.stdout}`);
|
|
243
|
+
const out = JSON.parse(r.stdout as string);
|
|
244
|
+
assert.equal(out.verdict, 'settled_empty');
|
|
245
|
+
assert.equal(out.headChanged, true);
|
|
246
|
+
});
|
|
247
|
+
|
|
248
|
+
test('a relative baseline resolves under .hometrans and supplies dispatch_at', (t) => {
|
|
249
|
+
const fx = makeFx(t);
|
|
250
|
+
const pre = initF0(fx);
|
|
251
|
+
writeAt(path.join(fx.wave, 'shared_manifest.json'), T0 + 1_000,
|
|
252
|
+
JSON.stringify({ campaign_id: 'C', base: pre }));
|
|
253
|
+
const r = run(fx, '--baseline', 'wave_1/reply_recovery_f0.json',
|
|
254
|
+
'--once', '--now', iso(NOW));
|
|
255
|
+
assert.equal(r.status, 0, `${r.stderr}${r.stdout}`);
|
|
256
|
+
assert.equal(JSON.parse(r.stdout as string).verdict, 'artifact_fresh');
|
|
257
|
+
});
|
|
258
|
+
|
|
259
|
+
test('a missing baseline is a usage error', (t) => {
|
|
260
|
+
const fx = makeFx(t);
|
|
261
|
+
const r = run(fx, '--stage', 'f0', '--wave', '1', '--once');
|
|
262
|
+
assert.equal(r.status, 2, `${r.stderr}${r.stdout}`);
|
|
263
|
+
});
|
|
264
|
+
|
|
265
|
+
test('loop mode returns pending at the slice boundary, not settled_empty', (t) => {
|
|
266
|
+
const fx = makeFx(t);
|
|
267
|
+
initF0(fx);
|
|
268
|
+
const r = run(fx, '--stage', 'f0', '--wave', '1', '--now', iso(T0 + 10_000),
|
|
269
|
+
'--slice-ms', '100', '--poll-ms', '50', '--wait-ms', '600000');
|
|
270
|
+
assert.equal(r.status, 3, `${r.stderr}${r.stdout}`);
|
|
271
|
+
assert.equal(JSON.parse(r.stdout as string).verdict, 'pending');
|
|
272
|
+
});
|
|
273
|
+
|
|
274
|
+
test('b3: a short sha of pre_head is still not a new commit', (t) => {
|
|
275
|
+
const fx = makeFx(t);
|
|
276
|
+
const a = gitOut(fx, 'rev-parse', 'HEAD');
|
|
277
|
+
const outDir = initB3(fx, a);
|
|
278
|
+
writeAt(path.join(outDir, 'build-fix-report.md'), T0 + 1_000, 'Build Status: SUCCESS\n');
|
|
279
|
+
writeAt(path.join(outDir, 'build-fix-commit-info.md'), T0 + 1_000, `commit_id: ${a.slice(0, 7)}\n`);
|
|
280
|
+
const r = settleB3(fx, outDir);
|
|
281
|
+
assert.equal(r.status, 3, `${r.stderr}${r.stdout}`);
|
|
282
|
+
const out = JSON.parse(r.stdout as string);
|
|
283
|
+
assert.equal(out.artifacts[1]!.state, 'invalid');
|
|
284
|
+
assert.equal(out.artifacts[1]!.note, 'not-a-new-commit');
|
|
285
|
+
});
|
|
286
|
+
|
|
287
|
+
test('b3: markdown-bold Build Status is accepted', (t) => {
|
|
288
|
+
const fx = makeFx(t);
|
|
289
|
+
const a = gitOut(fx, 'rev-parse', 'HEAD');
|
|
290
|
+
const outDir = initB3(fx, a);
|
|
291
|
+
writeAt(path.join(outDir, 'build-fix-report.md'), T0 + 1_000, '1. **Build Status**: SUCCESS\n');
|
|
292
|
+
writeAt(path.join(outDir, 'build-fix-commit-info.md'), T0 + 1_000, 'commit_id: none\n');
|
|
293
|
+
const r = settleB3(fx, outDir);
|
|
294
|
+
assert.equal(r.status, 0, `${r.stderr}${r.stdout}`);
|
|
295
|
+
const out = JSON.parse(r.stdout as string);
|
|
296
|
+
assert.equal(out.verdict, 'artifact_fresh');
|
|
297
|
+
assert.equal(out.quietMs, 660_000);
|
|
298
|
+
});
|
|
299
|
+
|
|
300
|
+
test('b3: commit_id none with a dirty tree is invalid', (t) => {
|
|
301
|
+
const fx = makeFx(t);
|
|
302
|
+
const a = gitOut(fx, 'rev-parse', 'HEAD');
|
|
303
|
+
const outDir = initB3(fx, a);
|
|
304
|
+
writeAt(path.join(outDir, 'build-fix-report.md'), T0 + 1_000, 'Build Status: SUCCESS\n');
|
|
305
|
+
writeAt(path.join(outDir, 'build-fix-commit-info.md'), T0 + 1_000, 'commit_id: none\n');
|
|
306
|
+
writeFileSync(path.join(fx.hmos, 'src.txt'), 'dirty\n', 'utf8');
|
|
307
|
+
const r = settleB3(fx, outDir);
|
|
308
|
+
const out = JSON.parse(r.stdout as string);
|
|
309
|
+
assert.equal(out.artifacts[1]!.state, 'invalid');
|
|
310
|
+
assert.equal(out.artifacts[1]!.note, 'none-but-dirty-tree');
|
|
311
|
+
});
|
|
312
|
+
|
|
313
|
+
test('b3: a commit outside HEAD is rejected', (t) => {
|
|
314
|
+
const fx = makeFx(t);
|
|
315
|
+
const a = gitOut(fx, 'rev-parse', 'HEAD');
|
|
316
|
+
const outDir = initB3(fx, a);
|
|
317
|
+
const branch = gitOut(fx, 'rev-parse', '--abbrev-ref', 'HEAD');
|
|
318
|
+
gitOut(fx, 'checkout', '--orphan', 'other');
|
|
319
|
+
gitOut(fx, 'commit', '--allow-empty', '-q', '-m', 'other');
|
|
320
|
+
const b = gitOut(fx, 'rev-parse', 'HEAD');
|
|
321
|
+
gitOut(fx, 'checkout', '-q', branch);
|
|
322
|
+
writeAt(path.join(outDir, 'build-fix-report.md'), T0 + 1_000, 'Build Status: SUCCESS\n');
|
|
323
|
+
writeAt(path.join(outDir, 'build-fix-commit-info.md'), T0 + 1_000, `commit_id: ${b}\n`);
|
|
324
|
+
const r = settleB3(fx, outDir);
|
|
325
|
+
const out = JSON.parse(r.stdout as string);
|
|
326
|
+
assert.equal(out.artifacts[1]!.state, 'invalid');
|
|
327
|
+
});
|
|
328
|
+
|
|
329
|
+
test('a truncated scan is fail-closed, not settled_empty', (t) => {
|
|
330
|
+
const fx = makeFx(t);
|
|
331
|
+
initF0(fx);
|
|
332
|
+
writeAt(path.join(fx.wave, 'a.log'), T0);
|
|
333
|
+
writeAt(path.join(fx.wave, 'b.log'), T0);
|
|
334
|
+
const r = run(fx, '--stage', 'f0', '--wave', '1', '--once', '--now', iso(NOW),
|
|
335
|
+
'--scan-budget', '1');
|
|
336
|
+
assert.equal(r.status, 3, `${r.stderr}${r.stdout}`);
|
|
337
|
+
const out = JSON.parse(r.stdout as string);
|
|
338
|
+
assert.equal(out.verdict, 'pending');
|
|
339
|
+
assert.equal(out.activityTruncated, true);
|
|
340
|
+
});
|
|
341
|
+
|
|
342
|
+
test('a scan budget exactly consumed by the entries is not truncated', (t) => {
|
|
343
|
+
const fx = makeFx(t);
|
|
344
|
+
initF0(fx);
|
|
345
|
+
const r = run(fx, '--stage', 'f0', '--wave', '1', '--once', '--now', iso(T0 + 10_000),
|
|
346
|
+
'--scan-budget', '1');
|
|
347
|
+
assert.equal(r.status, 3, `${r.stderr}${r.stdout}`);
|
|
348
|
+
const out = JSON.parse(r.stdout as string);
|
|
349
|
+
assert.equal(out.activityTruncated, false);
|
|
350
|
+
assert.equal(out.verdict, 'pending');
|
|
351
|
+
});
|
|
352
|
+
|
|
353
|
+
test('a future file does not erase real recent activity', (t) => {
|
|
354
|
+
const fx = makeFx(t);
|
|
355
|
+
initF0(fx);
|
|
356
|
+
writeAt(path.join(fx.wave, 'real.log'), NOW - 30_000);
|
|
357
|
+
writeAt(path.join(fx.wave, 'future.log'), NOW + 3_600_000);
|
|
358
|
+
const r = settleF0(fx);
|
|
359
|
+
assert.equal(r.status, 3, `${r.stderr}${r.stdout}`);
|
|
360
|
+
const out = JSON.parse(r.stdout as string);
|
|
361
|
+
assert.equal(out.verdict, 'pending');
|
|
362
|
+
assert.equal(out.clockSkew, true);
|
|
363
|
+
});
|
|
364
|
+
|
|
365
|
+
test('a dirty list above the scan budget is fail-closed', (t) => {
|
|
366
|
+
const fx = makeFx(t);
|
|
367
|
+
initF0(fx);
|
|
368
|
+
for (const name of ['a.txt', 'b.txt', 'c.txt']) {
|
|
369
|
+
writeAt(path.join(fx.hmos, name), T0 - 3_600_000, name);
|
|
370
|
+
}
|
|
371
|
+
const r = run(fx, '--stage', 'f0', '--wave', '1', '--once', '--now', iso(NOW),
|
|
372
|
+
'--scan-budget', '2');
|
|
373
|
+
assert.equal(r.status, 3, `${r.stderr}${r.stdout}`);
|
|
374
|
+
const out = JSON.parse(r.stdout as string);
|
|
375
|
+
assert.equal(out.verdict, 'pending');
|
|
376
|
+
assert.equal(out.activityTruncated, true);
|
|
377
|
+
});
|
|
378
|
+
|
|
379
|
+
test('a lone future artifact stays quiet but is flagged', (t) => {
|
|
380
|
+
const fx = makeFx(t);
|
|
381
|
+
const pre = initF0(fx);
|
|
382
|
+
writeAt(path.join(fx.wave, 'shared_manifest.json'), NOW + 3_600_000,
|
|
383
|
+
JSON.stringify({ campaign_id: 'C', base: pre }));
|
|
384
|
+
const r = settleF0(fx);
|
|
385
|
+
assert.equal(r.status, 3, `${r.stderr}${r.stdout}`);
|
|
386
|
+
const out = JSON.parse(r.stdout as string);
|
|
387
|
+
assert.equal(out.verdict, 'settled_empty');
|
|
388
|
+
assert.equal(out.artifacts[0]!.state, 'invalid');
|
|
389
|
+
assert.equal(out.artifacts[0]!.note, 'future-mtime');
|
|
390
|
+
assert.equal(out.clockSkew, true);
|
|
391
|
+
});
|
|
392
|
+
|
|
393
|
+
test('f0 init requires campaign/base; stage must match the baseline', (t) => {
|
|
394
|
+
const fx = makeFx(t);
|
|
395
|
+
const bad = run(fx, '--stage', 'f0', '--wave', '1', '--dispatch-at', iso(T0), '--init');
|
|
396
|
+
assert.equal(bad.status, 2, `${bad.stderr}${bad.stdout}`);
|
|
397
|
+
initF0(fx);
|
|
398
|
+
const mismatch = run(fx, '--stage', 'b3', '--wave', '1',
|
|
399
|
+
'--baseline', 'wave_1/reply_recovery_f0.json', '--once');
|
|
400
|
+
assert.equal(mismatch.status, 2, `${mismatch.stderr}${mismatch.stdout}`);
|
|
401
|
+
});
|
|
402
|
+
|
|
403
|
+
test('init refuses to overwrite a baseline without --force', (t) => {
|
|
404
|
+
const fx = makeFx(t);
|
|
405
|
+
initF0(fx);
|
|
406
|
+
const again = run(fx, '--stage', 'f0', '--wave', '1', '--dispatch-at', iso(T0),
|
|
407
|
+
'--campaign-id', 'C', '--base', gitOut(fx, 'rev-parse', 'HEAD'), '--init');
|
|
408
|
+
assert.equal(again.status, 2, `${again.stderr}${again.stdout}`);
|
|
409
|
+
const forced = run(fx, '--stage', 'f0', '--wave', '1', '--dispatch-at', iso(T0),
|
|
410
|
+
'--campaign-id', 'C', '--base', gitOut(fx, 'rev-parse', 'HEAD'), '--init', '--force');
|
|
411
|
+
assert.equal(forced.status, 0, `${forced.stderr}${forced.stdout}`);
|
|
412
|
+
});
|
|
413
|
+
|
|
414
|
+
test('--wait-ms and --max-ms are aliases and cannot be combined', (t) => {
|
|
415
|
+
const fx = makeFx(t);
|
|
416
|
+
initF0(fx);
|
|
417
|
+
const r = run(fx, '--stage', 'f0', '--wave', '1', '--once',
|
|
418
|
+
'--wait-ms', '1000', '--max-ms', '2000');
|
|
419
|
+
assert.equal(r.status, 2, `${r.stderr}${r.stdout}`);
|
|
420
|
+
});
|
|
421
|
+
|
|
422
|
+
test('an untracked file rewritten inside a new directory counts as activity', (t) => {
|
|
423
|
+
const fx = makeFx(t);
|
|
424
|
+
initF0(fx);
|
|
425
|
+
const dir = path.join(fx.hmos, 'feature');
|
|
426
|
+
mkdirSync(dir, { recursive: true });
|
|
427
|
+
const file = path.join(dir, 'Index.ets');
|
|
428
|
+
writeFileSync(file, 'v1\n', 'utf8');
|
|
429
|
+
utimesSync(dir, new Date(T0 - 3_600_000), new Date(T0 - 3_600_000));
|
|
430
|
+
writeFileSync(file, 'v2\n', 'utf8');
|
|
431
|
+
utimesSync(file, new Date(NOW - 30_000), new Date(NOW - 30_000));
|
|
432
|
+
const r = settleF0(fx);
|
|
433
|
+
assert.equal(r.status, 3, `${r.stderr}${r.stdout}`);
|
|
434
|
+
const out = JSON.parse(r.stdout as string);
|
|
435
|
+
assert.equal(out.verdict, 'pending');
|
|
436
|
+
assert.ok(out.dirty.includes('feature/Index.ets'), JSON.stringify(out.dirty));
|
|
437
|
+
});
|
|
438
|
+
|
|
439
|
+
test('deleting a tracked file counts as activity', (t) => {
|
|
440
|
+
const fx = makeFx(t);
|
|
441
|
+
initF0(fx);
|
|
442
|
+
rmSync(path.join(fx.hmos, 'src.txt'));
|
|
443
|
+
const r = settleF0(fx);
|
|
444
|
+
assert.equal(r.status, 3, `${r.stderr}${r.stdout}`);
|
|
445
|
+
const out = JSON.parse(r.stdout as string);
|
|
446
|
+
assert.equal(out.verdict, 'pending');
|
|
447
|
+
assert.ok(out.dirty.includes('src.txt'), JSON.stringify(out.dirty));
|
|
448
|
+
});
|
|
449
|
+
|
|
450
|
+
test('probe --artifact must include every baseline target', (t) => {
|
|
451
|
+
const fx = makeFx(t);
|
|
452
|
+
const a = gitOut(fx, 'rev-parse', 'HEAD');
|
|
453
|
+
const outDir = initB3(fx, a);
|
|
454
|
+
const report = path.join(outDir, 'build-fix-report.md');
|
|
455
|
+
writeAt(report, T0 + 1_000, 'Build Status: SUCCESS\n');
|
|
456
|
+
const r = run(fx, '--stage', 'b3', '--wave', '1', '--output', outDir,
|
|
457
|
+
'--artifact', report, '--once', '--now', iso(NOW));
|
|
458
|
+
assert.equal(r.status, 2, `${r.stderr}${r.stdout}`);
|
|
459
|
+
});
|
|
460
|
+
|
|
461
|
+
test('probe rejects ownership overrides that differ from the baseline', (t) => {
|
|
462
|
+
const fx = makeFx(t);
|
|
463
|
+
const pre = initF0(fx);
|
|
464
|
+
writeAt(path.join(fx.wave, 'shared_manifest.json'), T0 + 1_000,
|
|
465
|
+
JSON.stringify({ campaign_id: 'C', base: pre }));
|
|
466
|
+
const campaign = settleF0(fx, ['--campaign-id', 'OTHER']);
|
|
467
|
+
assert.equal(campaign.status, 2, `${campaign.stderr}${campaign.stdout}`);
|
|
468
|
+
const base = settleF0(fx, ['--base', 'deadbeef']);
|
|
469
|
+
assert.equal(base.status, 2, `${base.stderr}${base.stdout}`);
|
|
470
|
+
const dispatch = settleF0(fx, ['--dispatch-at', iso(T0 + 1_000)]);
|
|
471
|
+
assert.equal(dispatch.status, 2, `${dispatch.stderr}${dispatch.stdout}`);
|
|
472
|
+
const preHead = settleF0(fx, ['--pre-head', 'deadbeef']);
|
|
473
|
+
assert.equal(preHead.status, 2, `${preHead.stderr}${preHead.stdout}`);
|
|
474
|
+
});
|
|
475
|
+
|
|
476
|
+
test('report prose does not satisfy the Build Status contract', (t) => {
|
|
477
|
+
const fx = makeFx(t);
|
|
478
|
+
const a = gitOut(fx, 'rev-parse', 'HEAD');
|
|
479
|
+
const outDir = initB3(fx, a);
|
|
480
|
+
writeAt(path.join(outDir, 'build-fix-report.md'), T0 + 1_000,
|
|
481
|
+
'Earlier attempt: Build Status: FAILED, then fixed\n');
|
|
482
|
+
writeAt(path.join(outDir, 'build-fix-commit-info.md'), T0 + 1_000, 'commit_id: none\n');
|
|
483
|
+
const r = settleB3(fx, outDir);
|
|
484
|
+
const out = JSON.parse(r.stdout as string);
|
|
485
|
+
assert.equal(out.artifacts[0]!.state, 'invalid');
|
|
486
|
+
assert.equal(out.artifacts[0]!.note, 'report-status-missing');
|
|
487
|
+
});
|
|
488
|
+
|
|
489
|
+
test('round-specific baselines allow a second review round', (t) => {
|
|
490
|
+
const fx = makeFx(t);
|
|
491
|
+
const pre = gitOut(fx, 'rev-parse', 'HEAD');
|
|
492
|
+
for (const name of ['r1.json', 'r2.json']) {
|
|
493
|
+
const r = run(fx, '--init', '--stage', 'f0', '--wave', '1',
|
|
494
|
+
'--dispatch-at', iso(T0), '--campaign-id', 'C', '--base', pre,
|
|
495
|
+
'--baseline', `wave_1/${name}`);
|
|
496
|
+
assert.equal(r.status, 0, `${r.stderr}${r.stdout}`);
|
|
497
|
+
}
|
|
498
|
+
});
|
|
499
|
+
|
|
500
|
+
test('init stores resolved OIDs even when given the literal HEAD', (t) => {
|
|
501
|
+
const fx = makeFx(t);
|
|
502
|
+
const pre = gitOut(fx, 'rev-parse', 'HEAD');
|
|
503
|
+
const outDir = path.join(fx.wave, 'build');
|
|
504
|
+
const init = run(fx, '--init', '--stage', 'b3', '--wave', '1', '--dispatch-at', iso(T0),
|
|
505
|
+
'--output', outDir, '--pre-head', 'HEAD');
|
|
506
|
+
assert.equal(init.status, 0, `${init.stderr}${init.stdout}`);
|
|
507
|
+
const b = JSON.parse(readFileSync(path.join(fx.wave, 'reply_recovery_b3.json'), 'utf8'));
|
|
508
|
+
assert.equal(b.pre_head, pre);
|
|
509
|
+
gitOut(fx, 'commit', '--allow-empty', '-q', '-m', 'moved');
|
|
510
|
+
writeAt(path.join(outDir, 'build-fix-report.md'), T0 + 1_000, 'Build Status: SUCCESS\n');
|
|
511
|
+
writeAt(path.join(outDir, 'build-fix-commit-info.md'), T0 + 1_000, 'commit_id: none\n');
|
|
512
|
+
const r = run(fx, '--stage', 'b3', '--wave', '1', '--output', outDir, '--once', '--now', iso(NOW));
|
|
513
|
+
assert.equal(r.status, 3, `${r.stderr}${r.stdout}`);
|
|
514
|
+
assert.equal(JSON.parse(r.stdout as string).artifacts[1]!.note, 'none-but-head-moved');
|
|
515
|
+
});
|
|
516
|
+
|
|
517
|
+
test('f0 accepts a short --base when the manifest has the full sha', (t) => {
|
|
518
|
+
const fx = makeFx(t);
|
|
519
|
+
const pre = gitOut(fx, 'rev-parse', 'HEAD');
|
|
520
|
+
const init = run(fx, '--init', '--stage', 'f0', '--wave', '1',
|
|
521
|
+
'--dispatch-at', iso(T0), '--campaign-id', 'C', '--base', pre.slice(0, 8));
|
|
522
|
+
assert.equal(init.status, 0, `${init.stderr}${init.stdout}`);
|
|
523
|
+
writeAt(path.join(fx.wave, 'shared_manifest.json'), T0 + 1_000,
|
|
524
|
+
JSON.stringify({ campaign_id: 'C', base: pre }));
|
|
525
|
+
const r = settleF0(fx);
|
|
526
|
+
assert.equal(r.status, 0, `${r.stderr}${r.stdout}`);
|
|
527
|
+
assert.equal(JSON.parse(r.stdout as string).verdict, 'artifact_fresh');
|
|
528
|
+
});
|
|
529
|
+
|
|
530
|
+
test('a dirty path with a future mtime is skew, not endless activity', (t) => {
|
|
531
|
+
const fx = makeFx(t);
|
|
532
|
+
initF0(fx);
|
|
533
|
+
writeFileSync(path.join(fx.hmos, 'src.txt'), 'future\n', 'utf8');
|
|
534
|
+
utimesSync(path.join(fx.hmos, 'src.txt'), new Date(NOW + 3_600_000), new Date(NOW + 3_600_000));
|
|
535
|
+
const later = NOW + 2_400_000;
|
|
536
|
+
const r = run(fx, '--stage', 'f0', '--wave', '1', '--once', '--now', iso(later));
|
|
537
|
+
assert.equal(r.status, 3, `${r.stderr}${r.stdout}`);
|
|
538
|
+
const out = JSON.parse(r.stdout as string);
|
|
539
|
+
assert.equal(out.verdict, 'settled_empty');
|
|
540
|
+
assert.equal(out.clockSkew, true);
|
|
541
|
+
});
|
|
542
|
+
|
|
543
|
+
test('b4-rebuild requires a round-specific baseline at init and probe', (t) => {
|
|
544
|
+
const fx = makeFx(t);
|
|
545
|
+
const pre = gitOut(fx, 'rev-parse', 'HEAD');
|
|
546
|
+
const outDir = path.join(fx.wave, 'review_round_1', 'build');
|
|
547
|
+
const init = run(fx, '--init', '--stage', 'b4-rebuild', '--wave', '1',
|
|
548
|
+
'--dispatch-at', iso(T0), '--output', outDir, '--pre-head', pre);
|
|
549
|
+
assert.equal(init.status, 2, `${init.stderr}${init.stdout}`);
|
|
550
|
+
const probe = run(fx, '--stage', 'b4-rebuild', '--wave', '1',
|
|
551
|
+
'--output', outDir, '--once');
|
|
552
|
+
assert.equal(probe.status, 2, `${probe.stderr}${probe.stdout}`);
|
|
553
|
+
});
|
|
554
|
+
|
|
555
|
+
test('init rejects an unresolvable pre-head/base', (t) => {
|
|
556
|
+
const fx = makeFx(t);
|
|
557
|
+
const outDir = path.join(fx.wave, 'build');
|
|
558
|
+
const badPre = run(fx, '--init', '--stage', 'b3', '--wave', '1', '--dispatch-at', iso(T0),
|
|
559
|
+
'--output', outDir, '--pre-head', 'deadbeef');
|
|
560
|
+
assert.equal(badPre.status, 2, `${badPre.stderr}${badPre.stdout}`);
|
|
561
|
+
const badBase = run(fx, '--init', '--stage', 'f0', '--wave', '1', '--dispatch-at', iso(T0),
|
|
562
|
+
'--campaign-id', 'C', '--base', 'deadbeef');
|
|
563
|
+
assert.equal(badBase.status, 2, `${badBase.stderr}${badBase.stdout}`);
|
|
564
|
+
});
|
|
565
|
+
|
|
566
|
+
test('numeric knobs reject zero/explicit invalid values', (t) => {
|
|
567
|
+
const fx = makeFx(t);
|
|
568
|
+
initF0(fx);
|
|
569
|
+
const wait = run(fx, '--stage', 'f0', '--wave', '1', '--once', '--wait-ms', '0');
|
|
570
|
+
assert.equal(wait.status, 2, `${wait.stderr}${wait.stdout}`);
|
|
571
|
+
const scan = run(fx, '--stage', 'f0', '--wave', '1', '--once', '--scan-budget', '0');
|
|
572
|
+
assert.equal(scan.status, 2, `${scan.stderr}${scan.stdout}`);
|
|
573
|
+
});
|
|
574
|
+
|
|
575
|
+
test('b4-rebuild round baselines keep round 1 and round 2 independent', (t) => {
|
|
576
|
+
const fx = makeFx(t);
|
|
577
|
+
const pre = gitOut(fx, 'rev-parse', 'HEAD');
|
|
578
|
+
const round = (r: number) => {
|
|
579
|
+
const outDir = path.join(fx.wave, `review_round_${r}`, 'build');
|
|
580
|
+
const baseline = path.join(fx.wave, `review_round_${r}`, 'reply_recovery_b4-rebuild.json');
|
|
581
|
+
const init = run(fx, '--init', '--stage', 'b4-rebuild', '--wave', '1',
|
|
582
|
+
'--dispatch-at', iso(T0), '--output', outDir, '--pre-head', pre, '--baseline', baseline);
|
|
583
|
+
assert.equal(init.status, 0, `${init.stderr}${init.stdout}`);
|
|
584
|
+
writeAt(path.join(outDir, 'build-fix-report.md'), T0 + 1_000, 'Build Status: SUCCESS\n');
|
|
585
|
+
writeAt(path.join(outDir, 'build-fix-commit-info.md'), T0 + 1_000, 'commit_id: none\n');
|
|
586
|
+
const probe = run(fx, '--stage', 'b4-rebuild', '--wave', '1', '--output', outDir,
|
|
587
|
+
'--baseline', baseline, '--once', '--now', iso(NOW));
|
|
588
|
+
assert.equal(probe.status, 0, `${probe.stderr}${probe.stdout}`);
|
|
589
|
+
assert.equal(JSON.parse(probe.stdout as string).verdict, 'artifact_fresh');
|
|
590
|
+
};
|
|
591
|
+
round(1);
|
|
592
|
+
round(2);
|
|
593
|
+
});
|