@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.
Files changed (472) hide show
  1. package/README.md +249 -279
  2. package/agents/code-reviewer.md +1 -1
  3. package/dist/cli/editors.json +20 -0
  4. package/dist/platform/registry.js +1 -0
  5. package/dist/platform/validate.js +2 -1
  6. package/i18n/agents/code-reviewer.md +1 -1
  7. package/i18n/platforms/atomcode/skills/a2h-app-migrate/SKILL.unique.md +3 -0
  8. package/i18n/platforms/claude-code/skills/a2h-app-migrate/SKILL.unique.md +3 -0
  9. package/i18n/platforms/codebuddy/skills/a2h-app-migrate/SKILL.unique.md +8 -0
  10. package/i18n/platforms/codex/skills/a2h-app-migrate/SKILL.unique.md +3 -0
  11. package/i18n/platforms/cursor/skills/a2h-app-migrate/SKILL.unique.md +3 -0
  12. package/i18n/platforms/deveco/skills/a2h-app-migrate/SKILL.unique.md +3 -0
  13. package/i18n/platforms/opencode/skills/a2h-app-migrate/SKILL.unique.md +10 -0
  14. package/i18n/platforms/qoder/skills/a2h-app-migrate/SKILL.unique.md +3 -0
  15. package/i18n/platforms/qoder-cn/skills/a2h-app-migrate/SKILL.unique.md +8 -0
  16. package/i18n/platforms/trae/skills/a2h-app-migrate/SKILL.unique.md +3 -0
  17. package/i18n/platforms/trae-cn/skills/a2h-app-migrate/SKILL.unique.md +3 -0
  18. package/i18n/skills/a2h-app-migrate/SKILL.md +32 -15
  19. package/i18n/skills/a2h-app-migrate/references/stage-map.md +4 -2
  20. package/i18n/skills/a2h-app-migrate/references/workflow.yaml +148 -89
  21. package/i18n/skills/a2h-app-migrate/scripts/env_preflight.mjs +1 -1
  22. package/i18n/skills/a2h-app-migrate/scripts/validate_workflow.mjs +51 -2
  23. package/i18n/skills/a2h-app-migrate/test/test_build_fixer_contract.mjs +1 -1
  24. package/i18n/skills/a2h-app-migrate/test/test_interaction.mjs +0 -2
  25. package/i18n/skills/a2h-app-migrate/test/test_resume_plan.mjs +1 -1
  26. package/i18n/skills/a2h-app-migrate/test/test_skill_doc.mjs +1 -1
  27. package/i18n/skills/a2h-app-migrate/test/test_specs_json_preflight.mjs +1 -1
  28. package/i18n/skills/a2h-app-migrate/test/test_utg_static_done.mjs +9 -3
  29. package/i18n/skills/a2h-app-migrate/test/test_validate_workflow_bilingual.mjs +4 -2
  30. package/i18n/skills/a2h-arkts-logic-coder/SKILL.md +8 -7
  31. package/i18n/skills/a2h-arkts-logic-coder/references/ISSUES.md +2 -2
  32. package/i18n/skills/a2h-arkts-logic-coder/references/code-generation.md +33 -12
  33. package/i18n/skills/a2h-batch-ui-align/SKILL.md +14 -12
  34. package/i18n/skills/a2h-batch-ui-align/references/cards/alignment.md +1 -0
  35. package/i18n/skills/a2h-batch-ui-align/references/cards/canvas.md +1 -0
  36. package/i18n/skills/a2h-batch-ui-align/references/cards/dynamics.md +32 -1
  37. package/i18n/skills/a2h-batch-ui-align/references/cards/geometry.md +3 -2
  38. package/i18n/skills/a2h-batch-ui-align/references/cards/interaction.md +4 -0
  39. package/i18n/skills/a2h-batch-ui-align/references/cards/resources.md +19 -1
  40. package/i18n/skills/a2h-batch-ui-align/references/cards/widgets.md +13 -1
  41. package/i18n/skills/a2h-batch-ui-align/references/cards/window.md +2 -2
  42. package/i18n/skills/a2h-batch-ui-align/references/checker-rules.md +205 -7
  43. package/i18n/skills/a2h-batch-ui-align/references/conversion-procedure.md +10 -17
  44. package/i18n/skills/a2h-batch-ui-align/references/incremental-scope.md +3 -4
  45. package/i18n/skills/a2h-batch-ui-align/references/lottie-integration.md +47 -2
  46. package/i18n/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-atomic-component-mapping-reference.md +52 -328
  47. package/i18n/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-interaction-mapping-reference.md +1 -138
  48. package/i18n/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-layout-mapping-reference.md +2 -11
  49. package/i18n/skills/a2h-batch-ui-align/references/state-mgmt/_paradigm-selection.md +1 -1
  50. package/i18n/skills/a2h-batch-ui-align/references/step3-capture.md +8 -23
  51. package/i18n/skills/a2h-batch-ui-align/references/step4-prepare.md +2 -1
  52. package/i18n/skills/a2h-batch-ui-align/references/step5-convert.md +17 -9
  53. package/i18n/skills/a2h-batch-ui-align/scripts/build_conversion_set.mjs +239 -16
  54. package/i18n/skills/a2h-batch-ui-align/scripts/group_pack.mjs +6 -0
  55. package/i18n/skills/a2h-batch-ui-align/scripts/icon_coverage.mjs +6 -3
  56. package/i18n/skills/a2h-batch-ui-align/scripts/measure_pack.ts +170 -10
  57. package/i18n/skills/a2h-batch-ui-align/scripts/phase5_check.mjs +42 -1
  58. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/main.ts +20 -1
  59. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/attr_chain.ts +81 -0
  60. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/click_handler.ts +140 -0
  61. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/collapsing_toolbar.ts +124 -0
  62. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/compose_semantics.ts +287 -0
  63. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/flowitem_width.ts +78 -0
  64. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/hit_test.ts +194 -8
  65. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/inset_stacked.ts +138 -0
  66. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/int_division.ts +181 -0
  67. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/layout_placement.ts +62 -2
  68. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/lottie_path.ts +77 -0
  69. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/lottie_ready.ts +109 -0
  70. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/media_tint.ts +88 -18
  71. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/relative_container_cycle.ts +140 -0
  72. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/relative_container_height.ts +2 -2
  73. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/see_through_overlay.ts +149 -0
  74. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/sheet_builder.ts +139 -0
  75. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/sheet_show_close.ts +53 -0
  76. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/space_between_optional.ts +115 -0
  77. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/theme_color.ts +7 -1
  78. package/i18n/skills/a2h-batch-ui-align/scripts/static_check/rules/width_fill.ts +160 -0
  79. package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_inset_stacked.test.mjs +155 -0
  80. package/i18n/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_layout_placement.test.mjs +60 -0
  81. package/i18n/skills/a2h-batch-ui-align/scripts/tests/build_conversion_set.test.mjs +38 -0
  82. package/i18n/skills/a2h-module-semantic-docs/SKILL.md +3 -2
  83. package/i18n/skills/a2h-page-specgen/SKILL.md +36 -5
  84. package/i18n/skills/a2h-page-specgen/references/behavior-ledger.md +89 -21
  85. package/i18n/skills/a2h-page-specgen/references/gates.md +33 -7
  86. package/i18n/skills/a2h-page-specgen/references/scenario-authoring.md +67 -13
  87. package/i18n/skills/a2h-page-specgen/references/spec-example.md +166 -32
  88. package/i18n/skills/a2h-page-specgen/references/spec-template.md +8 -5
  89. package/i18n/skills/a2h-page-specgen/scripts/behavior-audit.mjs +37 -1
  90. package/i18n/skills/a2h-page-specgen/scripts/behavior-discovery.mjs +241 -22
  91. package/i18n/skills/a2h-page-specgen/scripts/behavior-model.mjs +29 -2
  92. package/i18n/skills/a2h-page-specgen/scripts/behavior-reconcile.mjs +32 -0
  93. package/i18n/skills/a2h-page-specgen/scripts/contract-calls.mjs +715 -0
  94. package/i18n/skills/a2h-page-specgen/scripts/footprint.mjs +129 -2
  95. package/i18n/skills/a2h-page-specgen/scripts/gate.mjs +19 -10
  96. package/i18n/skills/a2h-page-specgen/scripts/lib/contracts.mjs +62 -3
  97. package/i18n/skills/a2h-page-specgen/scripts/lib/graph-evidence.mjs +27 -0
  98. package/i18n/skills/a2h-page-specgen/scripts/lib/hg.mjs +116 -6
  99. package/i18n/skills/a2h-page-specgen/scripts/operation-evidence.mjs +270 -29
  100. package/i18n/skills/a2h-page-specgen/scripts/prepare.mjs +26 -14
  101. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.prompt.md +118 -25
  102. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.worker.md +104 -19
  103. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.prompt.md +118 -25
  104. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.worker.md +104 -19
  105. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.discovery.json +216 -216
  106. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.json +1 -1
  107. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.post-review.json +2 -2
  108. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.prompt.md +118 -25
  109. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.worker.md +100 -15
  110. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.prompt.md +118 -25
  111. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.worker.md +104 -19
  112. package/i18n/skills/a2h-page-specgen/scripts/test/acceptance/authoring/run.mjs +155 -3
  113. package/i18n/skills/a2h-page-specgen/scripts/test/android-operation-evidence.test.mjs +529 -1
  114. package/i18n/skills/a2h-page-specgen/scripts/test/behavior-audit-pre.test.mjs +27 -0
  115. package/i18n/skills/a2h-page-specgen/scripts/test/behavior-discovery.test.mjs +158 -0
  116. package/i18n/skills/a2h-page-specgen/scripts/test/behavior-fixtures.mjs +11 -13
  117. package/i18n/skills/a2h-page-specgen/scripts/test/behavior-reconcile.test.mjs +97 -0
  118. package/i18n/skills/a2h-page-specgen/scripts/test/contract-calls.test.mjs +737 -0
  119. package/i18n/skills/a2h-page-specgen/scripts/test/contracts.test.mjs +75 -3
  120. package/i18n/skills/a2h-page-specgen/scripts/test/finalize.test.mjs +24 -0
  121. package/i18n/skills/a2h-page-specgen/scripts/test/fixtures/hg.mkdb.mjs +124 -0
  122. package/i18n/skills/a2h-page-specgen/scripts/test/footprint-resolve.test.mjs +6 -2
  123. package/i18n/skills/a2h-page-specgen/scripts/test/gate.test.mjs +106 -1
  124. package/i18n/skills/a2h-page-specgen/scripts/test/graph-evidence.test.mjs +32 -0
  125. package/i18n/skills/a2h-page-specgen/scripts/test/hg.test.mjs +12 -0
  126. package/i18n/skills/a2h-page-specgen/scripts/test/operation-reviews.test.mjs +6 -1
  127. package/i18n/skills/a2h-page-specgen/scripts/test/prompt-tpl.test.mjs +11 -3
  128. package/i18n/skills/a2h-page-specgen/scripts/test/protocol-docs.test.mjs +1 -1
  129. package/i18n/skills/a2h-page-specgen/scripts/test/recovery-e2e.test.mjs +1 -0
  130. package/i18n/skills/a2h-page-specgen/scripts/test/submit.test.mjs +159 -27
  131. package/i18n/skills/a2h-resource-convert/SKILL.md +1 -1
  132. package/i18n/skills/a2h-resource-convert/references/lottie-conversion-rules.md +2 -2
  133. package/i18n/skills/a2h-resource-convert/scripts/a2h_resource_convert.ts +124 -8
  134. package/i18n/skills/a2h-resource-convert/scripts/sync-framework-strings.mjs +147 -0
  135. package/i18n/skills/a2h-resource-convert/scripts/tests/framework_strings.test.mjs +131 -0
  136. package/i18n/skills/a2h-spec-design-pipeline/SKILL.md +15 -12
  137. package/i18n/skills/a2h-spec-design-pipeline/references/coding-loop.md +38 -10
  138. package/i18n/skills/a2h-spec-design-pipeline/references/initialization.md +2 -2
  139. package/i18n/skills/a2h-spec-design-pipeline/references/post-loop.md +2 -2
  140. package/i18n/skills/a2h-spec-design-pipeline/references/reply-recovery.md +172 -0
  141. package/i18n/skills/a2h-spec-design-pipeline/references/review-loop.md +2 -2
  142. package/i18n/skills/a2h-spec-design-pipeline/references/scripts.md +5 -3
  143. package/i18n/skills/a2h-spec-design-pipeline/references/state-and-resume.md +7 -1
  144. package/i18n/skills/a2h-spec-design-pipeline/scripts/plan_groups.ts +1 -1
  145. package/i18n/skills/a2h-spec-design-pipeline/scripts/test_plan_groups.ts +2 -0
  146. package/i18n/skills/a2h-spec-generate/references/input-formats.md +1 -1
  147. package/i18n/skills/a2h-utg-explorer/SKILL.md +11 -5
  148. package/i18n/skills/a2h-utg-explorer/references/architecture.md +37 -19
  149. package/i18n/skills/a2h-utg-explorer/scripts/compile_tasks.mjs +48 -3
  150. package/i18n/skills/a2h-utg-explorer/scripts/final_utg.mjs +21 -0
  151. package/i18n/skills/a2h-utg-explorer/scripts/recover_d.mjs +67 -8
  152. package/i18n/skills/a2h-utg-explorer/scripts/tests/diagnostics.test.mjs +32 -0
  153. package/i18n/skills/a2h-utg-explorer/scripts/tests/dialog_own_layout.test.mjs +40 -0
  154. package/i18n/skills/a2h-utg-explorer/scripts/utg_explorer/semantics.mjs +63 -2
  155. package/i18n/skills/a2h-utg-explorer/scripts/utg_explorer/task_runner.mjs +143 -14
  156. package/i18n/skills/a2h-utg-static/SKILL.md +3 -3
  157. package/i18n/skills/a2h-utg-static/references/ui-elements-static-utg-schema.md +4 -3
  158. package/i18n/skills/a2h-utg-static/scripts/click_paths.mjs +1 -1
  159. package/i18n/skills/a2h-utg-static/scripts/tests/test_compose_res_text.mjs +25 -0
  160. package/i18n/skills/a2h-utg-static/tools/convert_static_utg_to_ui_elements.ts +1 -0
  161. package/package.json +2 -1
  162. package/platforms/atomcode/skills/a2h-app-migrate/SKILL.unique.md +3 -0
  163. package/platforms/claude-code/skills/a2h-app-migrate/SKILL.unique.md +3 -0
  164. package/platforms/codebuddy/agents/build-fixer.frontmatter.md +5 -0
  165. package/platforms/codebuddy/agents/code-reviewer.frontmatter.md +5 -0
  166. package/platforms/codebuddy/agents/model-render-worker.frontmatter.md +5 -0
  167. package/platforms/codebuddy/agents/model-worker.frontmatter.md +5 -0
  168. package/platforms/codebuddy/agents/specgen-worker.frontmatter.md +5 -0
  169. package/platforms/codebuddy/skills/a2h-app-migrate/SKILL.unique.md +8 -0
  170. package/platforms/codex/skills/a2h-app-migrate/SKILL.unique.md +3 -0
  171. package/platforms/cursor/skills/a2h-app-migrate/SKILL.unique.md +3 -0
  172. package/platforms/deveco/agents/build-fixer.frontmatter.md +2 -0
  173. package/platforms/deveco/agents/code-reviewer.frontmatter.md +2 -0
  174. package/platforms/deveco/agents/model-render-worker.frontmatter.md +2 -0
  175. package/platforms/deveco/agents/model-worker.frontmatter.md +2 -0
  176. package/platforms/deveco/agents/specgen-worker.frontmatter.md +2 -0
  177. package/platforms/deveco/skills/a2h-app-migrate/SKILL.unique.md +3 -0
  178. package/platforms/opencode/agents/build-fixer.frontmatter.md +2 -0
  179. package/platforms/opencode/agents/code-reviewer.frontmatter.md +2 -0
  180. package/platforms/opencode/agents/model-render-worker.frontmatter.md +2 -0
  181. package/platforms/opencode/agents/model-worker.frontmatter.md +2 -0
  182. package/platforms/opencode/agents/specgen-worker.frontmatter.md +2 -0
  183. package/platforms/opencode/skills/a2h-app-migrate/SKILL.unique.md +10 -0
  184. package/platforms/qoder/skills/a2h-app-migrate/SKILL.unique.md +3 -0
  185. package/platforms/qoder-cn/skills/a2h-app-migrate/SKILL.unique.md +8 -0
  186. package/platforms/trae/skills/a2h-app-migrate/SKILL.unique.md +3 -0
  187. package/platforms/trae-cn/skills/a2h-app-migrate/SKILL.unique.md +3 -0
  188. package/skills/a2h-app-migrate/SKILL.md +31 -14
  189. package/skills/a2h-app-migrate/references/stage-map.md +4 -2
  190. package/skills/a2h-app-migrate/references/workflow.yaml +152 -89
  191. package/skills/a2h-app-migrate/scripts/assert_dag_complete.mjs +1 -1
  192. package/skills/a2h-app-migrate/scripts/check_ui_batch_done.mjs +28 -11
  193. package/skills/a2h-app-migrate/scripts/dag_action_catalog.mjs +76 -0
  194. package/skills/a2h-app-migrate/scripts/dag_production_executor.mjs +60 -5
  195. package/skills/a2h-app-migrate/scripts/dag_runner.mjs +184 -4
  196. package/skills/a2h-app-migrate/scripts/env_preflight.mjs +1 -1
  197. package/skills/a2h-app-migrate/scripts/ledger.mjs +2 -2
  198. package/skills/a2h-app-migrate/scripts/resume_plan.mjs +3 -3
  199. package/skills/a2h-app-migrate/scripts/validate_workflow.mjs +51 -2
  200. package/skills/a2h-app-migrate/test/test_dag_blocked_guard.mjs +291 -0
  201. package/skills/a2h-app-migrate/test/test_dag_production.mjs +40 -0
  202. package/skills/a2h-app-migrate/test/test_dag_runner.mjs +4 -3
  203. package/skills/a2h-app-migrate/test/test_i18n_engine_mirror.mjs +1 -1
  204. package/skills/a2h-app-migrate/test/test_interaction.mjs +0 -2
  205. package/skills/a2h-app-migrate/test/test_resume_plan.mjs +1 -1
  206. package/skills/a2h-app-migrate/test/test_skill_doc.mjs +1 -1
  207. package/skills/a2h-app-migrate/test/test_spec_engine_contract.mjs +1 -1
  208. package/skills/a2h-app-migrate/test/test_specs_json_preflight.mjs +1 -1
  209. package/skills/a2h-app-migrate/test/test_ui_batch_done.mjs +36 -0
  210. package/skills/a2h-app-migrate/test/test_utg_static_done.mjs +19 -6
  211. package/skills/a2h-app-migrate/test/test_validate_workflow_bilingual.mjs +4 -2
  212. package/skills/a2h-arkts-logic-coder/SKILL.md +8 -7
  213. package/skills/a2h-arkts-logic-coder/references/ISSUES.md +2 -2
  214. package/skills/a2h-arkts-logic-coder/references/code-generation.md +33 -12
  215. package/skills/a2h-batch-ui-align/SKILL.md +14 -12
  216. package/skills/a2h-batch-ui-align/references/cards/alignment.md +1 -0
  217. package/skills/a2h-batch-ui-align/references/cards/canvas.md +1 -0
  218. package/skills/a2h-batch-ui-align/references/cards/dynamics.md +32 -1
  219. package/skills/a2h-batch-ui-align/references/cards/geometry.md +3 -2
  220. package/skills/a2h-batch-ui-align/references/cards/interaction.md +4 -0
  221. package/skills/a2h-batch-ui-align/references/cards/resources.md +19 -1
  222. package/skills/a2h-batch-ui-align/references/cards/widgets.md +13 -1
  223. package/skills/a2h-batch-ui-align/references/cards/window.md +2 -2
  224. package/skills/a2h-batch-ui-align/references/checker-rules.md +205 -7
  225. package/skills/a2h-batch-ui-align/references/conversion-procedure.md +10 -17
  226. package/skills/a2h-batch-ui-align/references/incremental-scope.md +3 -4
  227. package/skills/a2h-batch-ui-align/references/lottie-integration.md +47 -2
  228. package/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-atomic-component-mapping-reference.md +52 -328
  229. package/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-interaction-mapping-reference.md +1 -138
  230. package/skills/a2h-batch-ui-align/references/mappings/android-to-harmonyOS-ui-layout-mapping-reference.md +2 -11
  231. 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
  232. package/skills/a2h-batch-ui-align/references/step3-capture.md +8 -23
  233. package/skills/a2h-batch-ui-align/references/step4-prepare.md +2 -1
  234. package/skills/a2h-batch-ui-align/references/step5-convert.md +17 -9
  235. package/skills/a2h-batch-ui-align/scripts/build_conversion_set.mjs +239 -16
  236. package/skills/a2h-batch-ui-align/scripts/group_commit.mjs +6 -1
  237. package/skills/a2h-batch-ui-align/scripts/group_pack.mjs +6 -0
  238. package/skills/a2h-batch-ui-align/scripts/group_pass.mjs +270 -0
  239. package/skills/a2h-batch-ui-align/scripts/group_queue.mjs +134 -16
  240. package/skills/a2h-batch-ui-align/scripts/group_watch.mjs +39 -8
  241. package/skills/a2h-batch-ui-align/scripts/icon_coverage.mjs +6 -3
  242. package/skills/a2h-batch-ui-align/scripts/measure_pack.ts +170 -10
  243. package/skills/a2h-batch-ui-align/scripts/module_placement.mjs +189 -0
  244. package/skills/a2h-batch-ui-align/scripts/overlay_effects.mjs +205 -0
  245. package/skills/a2h-batch-ui-align/scripts/phase5_check.mjs +42 -1
  246. package/skills/a2h-batch-ui-align/scripts/static_check/main.ts +20 -1
  247. package/skills/a2h-batch-ui-align/scripts/static_check/registry.ts +28 -0
  248. package/skills/a2h-batch-ui-align/scripts/static_check/rules/attr_chain.ts +81 -0
  249. package/skills/a2h-batch-ui-align/scripts/static_check/rules/click_handler.ts +140 -0
  250. package/skills/a2h-batch-ui-align/scripts/static_check/rules/collapsing_toolbar.ts +124 -0
  251. package/skills/a2h-batch-ui-align/scripts/static_check/rules/compose_semantics.ts +287 -0
  252. package/skills/a2h-batch-ui-align/scripts/static_check/rules/flowitem_width.ts +78 -0
  253. package/skills/a2h-batch-ui-align/scripts/static_check/rules/hit_test.ts +194 -8
  254. package/skills/a2h-batch-ui-align/scripts/static_check/rules/inset_stacked.ts +138 -0
  255. package/skills/a2h-batch-ui-align/scripts/static_check/rules/int_division.ts +181 -0
  256. package/skills/a2h-batch-ui-align/scripts/static_check/rules/layout_placement.ts +62 -2
  257. package/skills/a2h-batch-ui-align/scripts/static_check/rules/lottie_path.ts +77 -0
  258. package/skills/a2h-batch-ui-align/scripts/static_check/rules/lottie_ready.ts +109 -0
  259. package/skills/a2h-batch-ui-align/scripts/static_check/rules/media_tint.ts +88 -18
  260. package/skills/a2h-batch-ui-align/scripts/static_check/rules/relative_container_cycle.ts +140 -0
  261. package/skills/a2h-batch-ui-align/scripts/static_check/rules/relative_container_height.ts +2 -2
  262. package/skills/a2h-batch-ui-align/scripts/static_check/rules/see_through_overlay.ts +149 -0
  263. package/skills/a2h-batch-ui-align/scripts/static_check/rules/sheet_builder.ts +139 -0
  264. package/skills/a2h-batch-ui-align/scripts/static_check/rules/sheet_show_close.ts +53 -0
  265. package/skills/a2h-batch-ui-align/scripts/static_check/rules/space_between_optional.ts +115 -0
  266. package/skills/a2h-batch-ui-align/scripts/static_check/rules/theme_color.ts +7 -1
  267. package/skills/a2h-batch-ui-align/scripts/static_check/rules/width_fill.ts +160 -0
  268. package/skills/a2h-batch-ui-align/scripts/static_check/scan_file.ts +28 -0
  269. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_chrome_defaults.test.mjs +328 -0
  270. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_click_handler.test.mjs +127 -0
  271. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_compose_semantics.test.mjs +150 -0
  272. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_hit_test.test.mjs +117 -0
  273. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_inset_stacked.test.mjs +155 -0
  274. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_layout_placement.test.mjs +60 -0
  275. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_rule_smoke.test.mjs +413 -0
  276. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_runtime_api.test.mjs +159 -0
  277. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_sheet_builder.test.mjs +192 -0
  278. package/skills/a2h-batch-ui-align/scripts/tests/arkts_static_check_theme.test.mjs +4 -2
  279. package/skills/a2h-batch-ui-align/scripts/tests/build_conversion_set.test.mjs +38 -0
  280. package/skills/a2h-batch-ui-align/scripts/tests/build_conversion_set_compose.test.mjs +106 -0
  281. package/skills/a2h-batch-ui-align/scripts/tests/group_commit.test.mjs +15 -0
  282. package/skills/a2h-batch-ui-align/scripts/tests/group_pass.test.mjs +150 -0
  283. package/skills/a2h-batch-ui-align/scripts/tests/group_queue.test.mjs +125 -0
  284. package/skills/a2h-batch-ui-align/scripts/tests/group_watch.test.mjs +56 -0
  285. package/skills/a2h-batch-ui-align/scripts/tests/measure_pack_icon_leaf.test.mjs +143 -0
  286. package/skills/a2h-batch-ui-align/scripts/tests/module_placement.test.mjs +248 -0
  287. package/skills/a2h-batch-ui-align/scripts/tests/overlay_effects.test.mjs +214 -0
  288. package/skills/a2h-fix-build-errors/references/known-patterns.md +5 -5
  289. package/skills/a2h-module-semantic-docs/SKILL.md +3 -2
  290. package/skills/a2h-module-semantic-docs/scripts/commit_module_state.mjs +10 -0
  291. package/skills/a2h-module-semantic-docs/scripts/design_baseline.mjs +158 -0
  292. package/skills/a2h-module-semantic-docs/test/test_design_baseline.mjs +128 -0
  293. package/skills/a2h-page-specgen/SKILL.md +36 -5
  294. package/skills/a2h-page-specgen/references/behavior-ledger.md +88 -21
  295. package/skills/a2h-page-specgen/references/evidence.md +2 -1
  296. package/skills/a2h-page-specgen/references/execution-model.md +13 -5
  297. package/skills/a2h-page-specgen/references/gates.md +33 -7
  298. package/skills/a2h-page-specgen/references/scenario-authoring.md +67 -13
  299. package/skills/a2h-page-specgen/references/spec-example.md +166 -32
  300. package/skills/a2h-page-specgen/references/spec-template.md +8 -5
  301. package/skills/a2h-page-specgen/scripts/behavior-audit.mjs +40 -2
  302. package/skills/a2h-page-specgen/scripts/behavior-discovery.mjs +241 -22
  303. package/skills/a2h-page-specgen/scripts/behavior-model.mjs +29 -2
  304. package/skills/a2h-page-specgen/scripts/behavior-reconcile.mjs +35 -2
  305. package/skills/a2h-page-specgen/scripts/contract-calls.mjs +715 -0
  306. package/skills/a2h-page-specgen/scripts/finalize.mjs +55 -2
  307. package/skills/a2h-page-specgen/scripts/footprint.mjs +129 -2
  308. package/skills/a2h-page-specgen/scripts/gate.mjs +20 -11
  309. package/skills/a2h-page-specgen/scripts/lib/contracts.mjs +56 -3
  310. package/skills/a2h-page-specgen/scripts/lib/graph-evidence.mjs +27 -0
  311. package/skills/a2h-page-specgen/scripts/lib/hg.mjs +114 -5
  312. package/skills/a2h-page-specgen/scripts/lib/ledger.mjs +20 -3
  313. package/skills/a2h-page-specgen/scripts/operation-evidence.mjs +270 -29
  314. package/skills/a2h-page-specgen/scripts/prepare.mjs +25 -14
  315. package/skills/a2h-page-specgen/scripts/report.mjs +26 -5
  316. package/skills/a2h-page-specgen/scripts/submission.mjs +69 -2
  317. package/skills/a2h-page-specgen/scripts/submit.mjs +105 -4
  318. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.prompt.md +110 -18
  319. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/PlainDisplayPage.worker.md +97 -12
  320. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.prompt.md +110 -18
  321. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/SilentFailurePage.worker.md +97 -12
  322. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.discovery.json +224 -224
  323. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.json +1 -1
  324. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.post-review.json +2 -2
  325. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.prompt.md +110 -18
  326. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/UniAppSourcePage.worker.md +97 -12
  327. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.prompt.md +110 -18
  328. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/ValidatedSearchPage.worker.md +97 -12
  329. package/skills/a2h-page-specgen/scripts/test/acceptance/authoring/run.mjs +153 -3
  330. package/skills/a2h-page-specgen/scripts/test/android-operation-evidence.test.mjs +529 -1
  331. package/skills/a2h-page-specgen/scripts/test/behavior-audit-pre.test.mjs +27 -0
  332. package/skills/a2h-page-specgen/scripts/test/behavior-discovery.test.mjs +158 -0
  333. package/skills/a2h-page-specgen/scripts/test/behavior-fixtures.mjs +11 -13
  334. package/skills/a2h-page-specgen/scripts/test/behavior-reconcile.test.mjs +97 -0
  335. package/skills/a2h-page-specgen/scripts/test/contract-calls.test.mjs +737 -0
  336. package/skills/a2h-page-specgen/scripts/test/contracts.test.mjs +82 -3
  337. package/skills/a2h-page-specgen/scripts/test/finalize.test.mjs +24 -0
  338. package/skills/a2h-page-specgen/scripts/test/fixtures/hg.mkdb.mjs +11 -0
  339. package/skills/a2h-page-specgen/scripts/test/footprint-resolve.test.mjs +6 -2
  340. package/skills/a2h-page-specgen/scripts/test/gate.test.mjs +94 -1
  341. package/skills/a2h-page-specgen/scripts/test/graph-evidence.test.mjs +32 -0
  342. package/skills/a2h-page-specgen/scripts/test/hg.test.mjs +14 -0
  343. package/skills/a2h-page-specgen/scripts/test/ledger.test.mjs +49 -1
  344. package/skills/a2h-page-specgen/scripts/test/operation-reviews.test.mjs +6 -1
  345. package/skills/a2h-page-specgen/scripts/test/prompt-tpl.test.mjs +12 -4
  346. package/skills/a2h-page-specgen/scripts/test/protocol-docs.test.mjs +1 -1
  347. package/skills/a2h-page-specgen/scripts/test/recovery-e2e.test.mjs +1 -0
  348. package/skills/a2h-page-specgen/scripts/test/report.test.mjs +80 -1
  349. package/skills/a2h-page-specgen/scripts/test/submit.test.mjs +159 -27
  350. package/skills/a2h-page-specgen/scripts/test/waker-process.test.mjs +23 -0
  351. package/skills/a2h-page-specgen/scripts/waker.mjs +8 -1
  352. package/skills/a2h-resource-convert/SKILL.md +1 -1
  353. package/skills/a2h-resource-convert/data/framework-strings/NOTICE +10 -0
  354. package/skills/a2h-resource-convert/data/framework-strings/manifest.json +90 -0
  355. package/skills/a2h-resource-convert/data/framework-strings/strings.json +382 -0
  356. package/skills/a2h-resource-convert/references/conversion-rules.md +7 -1
  357. package/skills/a2h-resource-convert/references/lottie-conversion-rules.md +2 -2
  358. package/skills/a2h-resource-convert/references/step5-reference-resolution.md +16 -0
  359. package/skills/a2h-resource-convert/scripts/a2h_resource_convert.ts +124 -8
  360. package/skills/a2h-resource-convert/scripts/sync-framework-strings.mjs +147 -0
  361. package/skills/a2h-resource-convert/scripts/tests/framework_strings.test.mjs +131 -0
  362. package/skills/a2h-spec-design-pipeline/SKILL.md +14 -11
  363. package/skills/a2h-spec-design-pipeline/references/coding-loop.md +38 -10
  364. package/skills/a2h-spec-design-pipeline/references/execution-model.md +3 -0
  365. package/skills/a2h-spec-design-pipeline/references/final-report-template.md +6 -3
  366. package/skills/a2h-spec-design-pipeline/references/initialization.md +2 -2
  367. package/skills/a2h-spec-design-pipeline/references/post-loop.md +2 -2
  368. package/skills/a2h-spec-design-pipeline/references/reply-recovery.md +172 -0
  369. package/skills/a2h-spec-design-pipeline/references/review-loop.md +2 -2
  370. package/skills/a2h-spec-design-pipeline/references/scripts.md +4 -3
  371. package/skills/a2h-spec-design-pipeline/references/shared-layer.md +24 -19
  372. package/skills/a2h-spec-design-pipeline/references/state-and-resume.md +7 -1
  373. package/skills/a2h-spec-design-pipeline/references/static-defect-gate.md +12 -5
  374. package/skills/a2h-spec-design-pipeline/rules/migration-rules/config/ruleMeta.json +5 -0
  375. package/skills/a2h-spec-design-pipeline/rules/migration-rules/config/ruleSet.json +4 -0
  376. package/skills/a2h-spec-design-pipeline/rules/migration-rules/data/README.md +27 -3
  377. package/skills/a2h-spec-design-pipeline/rules/migration-rules/data/api-param-contract.json +46 -1
  378. package/skills/a2h-spec-design-pipeline/rules/migration-rules/data/api-permission-map.json +2511 -295
  379. package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/api-permission-declared-cn.md +27 -72
  380. package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/api-permission-declared-en.md +39 -83
  381. package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/arkui-runtime-pitfall-cn.md +132 -101
  382. package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/arkui-runtime-pitfall-en.md +158 -115
  383. package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/platform-api-contract-cn.md +60 -93
  384. package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/platform-api-contract-en.md +73 -100
  385. package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/route-page-side-effect-import-cn.md +52 -0
  386. package/skills/a2h-spec-design-pipeline/rules/migration-rules/document/checker/hometrans/route-page-side-effect-import-en.md +59 -0
  387. package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/ApiPermissionDeclaredCheck.js +57 -8
  388. package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/ArkUIRuntimePitfallCheck.js +475 -18
  389. package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/PlatformApiContractCheck.js +472 -4
  390. package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/RoutePageSideEffectImportCheck.js +570 -0
  391. package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/arkui/RouteParamCarrierSubCheck.js +1053 -0
  392. package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/checker/sql/SqlIdentifierAnalysis.js +427 -0
  393. package/skills/a2h-spec-design-pipeline/rules/migration-rules/lib/index.js +7 -1
  394. package/skills/a2h-spec-design-pipeline/rules/migration-rules/package.json +1 -1
  395. package/skills/a2h-spec-design-pipeline/scripts/plan_groups.ts +1 -1
  396. package/skills/a2h-spec-design-pipeline/scripts/settle.ts +785 -0
  397. package/skills/a2h-spec-design-pipeline/scripts/test_api_permission_declared.ts +286 -0
  398. package/skills/a2h-spec-design-pipeline/scripts/test_arkui_runtime_pitfall.ts +166 -2
  399. package/skills/a2h-spec-design-pipeline/scripts/test_docs_refresh_contract.ts +40 -0
  400. package/skills/a2h-spec-design-pipeline/scripts/test_plan_groups.ts +2 -0
  401. package/skills/a2h-spec-design-pipeline/scripts/test_platform_api_contract.ts +350 -7
  402. package/skills/a2h-spec-design-pipeline/scripts/test_route_page_side_effect_import.ts +185 -0
  403. package/skills/a2h-spec-design-pipeline/scripts/test_route_param_carrier.ts +341 -0
  404. package/skills/a2h-spec-design-pipeline/scripts/test_settle.ts +593 -0
  405. package/skills/a2h-spec-design-pipeline/scripts/test_shared_layer_docs.ts +92 -1
  406. package/skills/a2h-spec-design-pipeline/scripts/test_sql_identifier_analysis.ts +137 -0
  407. package/skills/a2h-spec-generate/references/input-formats.md +1 -1
  408. package/skills/a2h-utg-explorer/SKILL.md +11 -5
  409. package/skills/a2h-utg-explorer/references/architecture.md +37 -19
  410. package/skills/a2h-utg-explorer/scripts/audit.mjs +6 -2
  411. package/skills/a2h-utg-explorer/scripts/close_phases.mjs +8 -5
  412. package/skills/a2h-utg-explorer/scripts/compile_tasks.mjs +95 -19
  413. package/skills/a2h-utg-explorer/scripts/d_prereqs.mjs +192 -4
  414. package/skills/a2h-utg-explorer/scripts/final_utg.mjs +21 -0
  415. package/skills/a2h-utg-explorer/scripts/panel_routes.mjs +1 -1
  416. package/skills/a2h-utg-explorer/scripts/plan.mjs +16 -1
  417. package/skills/a2h-utg-explorer/scripts/predicates.mjs +270 -0
  418. package/skills/a2h-utg-explorer/scripts/promote_dynamic.mjs +2 -0
  419. package/skills/a2h-utg-explorer/scripts/recover.mjs +4 -3
  420. package/skills/a2h-utg-explorer/scripts/recover_d.mjs +67 -8
  421. package/skills/a2h-utg-explorer/scripts/rejudge.mjs +4 -3
  422. package/skills/a2h-utg-explorer/scripts/report.mjs +32 -2
  423. package/skills/a2h-utg-explorer/scripts/run_cycle.mjs +103 -36
  424. package/skills/a2h-utg-explorer/scripts/run_device.mjs +3 -8
  425. package/skills/a2h-utg-explorer/scripts/schedule_states.mjs +189 -0
  426. package/skills/a2h-utg-explorer/scripts/tests/calendar_round_fixes.test.mjs +9 -0
  427. package/skills/a2h-utg-explorer/scripts/tests/coverage_rules.test.mjs +11 -0
  428. package/skills/a2h-utg-explorer/scripts/tests/d_prereqs.test.mjs +31 -2
  429. package/skills/a2h-utg-explorer/scripts/tests/device_lock_retry.test.mjs +1 -1
  430. package/skills/a2h-utg-explorer/scripts/tests/diagnostics.test.mjs +32 -0
  431. package/skills/a2h-utg-explorer/scripts/tests/dialog_own_layout.test.mjs +40 -0
  432. package/skills/a2h-utg-explorer/scripts/tests/explorer_review_fixes.test.mjs +4 -1
  433. package/skills/a2h-utg-explorer/scripts/tests/hybrid_route.test.mjs +6 -28
  434. package/skills/a2h-utg-explorer/scripts/tests/in_route_surface.test.mjs +125 -0
  435. package/skills/a2h-utg-explorer/scripts/tests/list_probe_target_wait.test.mjs +86 -0
  436. package/skills/a2h-utg-explorer/scripts/tests/multi_host.test.mjs +167 -0
  437. package/skills/a2h-utg-explorer/scripts/tests/nested_list.test.mjs +58 -0
  438. package/skills/a2h-utg-explorer/scripts/tests/overlay_opener.test.mjs +100 -0
  439. package/skills/a2h-utg-explorer/scripts/tests/pipeline.test.mjs +8 -1
  440. package/skills/a2h-utg-explorer/scripts/tests/pr169_review_fixes.test.mjs +1 -0
  441. package/skills/a2h-utg-explorer/scripts/tests/pr191_review_fixes.test.mjs +2 -31
  442. package/skills/a2h-utg-explorer/scripts/tests/review_fixes.test.mjs +1 -1
  443. package/skills/a2h-utg-explorer/scripts/tests/run_cycle.test.mjs +56 -7
  444. package/skills/a2h-utg-explorer/scripts/tests/snapshot_integrity.test.mjs +117 -6
  445. package/skills/a2h-utg-explorer/scripts/tests/state_inventory.test.mjs +414 -0
  446. package/skills/a2h-utg-explorer/scripts/tests/tree_unreliable.test.mjs +197 -0
  447. package/skills/a2h-utg-explorer/scripts/utg_explorer/adapters.mjs +196 -30
  448. package/skills/a2h-utg-explorer/scripts/utg_explorer/hosts.mjs +146 -0
  449. package/skills/a2h-utg-explorer/scripts/utg_explorer/semantics.mjs +63 -2
  450. package/skills/a2h-utg-explorer/scripts/utg_explorer/states.mjs +286 -0
  451. package/skills/a2h-utg-explorer/scripts/utg_explorer/task_runner.mjs +197 -19
  452. package/skills/a2h-utg-static/SKILL.md +3 -3
  453. package/skills/a2h-utg-static/references/extractors.md +7 -0
  454. package/skills/a2h-utg-static/references/ui-elements-static-utg-schema.md +4 -3
  455. package/skills/a2h-utg-static/scripts/click_paths.mjs +1 -1
  456. package/skills/a2h-utg-static/scripts/compose_overlay.mjs +642 -22
  457. package/skills/a2h-utg-static/scripts/tests/test_compose_res_text.mjs +25 -0
  458. package/skills/a2h-utg-static/scripts/tests/test_in_route_surface.mjs +123 -0
  459. package/skills/a2h-utg-static/scripts/tests/test_overlay_host_effects.mjs +239 -0
  460. package/skills/a2h-utg-static/scripts/tests/test_shared_host_depths.mjs +48 -0
  461. package/skills/a2h-utg-static/scripts/utg_html.mjs +2 -0
  462. package/skills/a2h-utg-static/tools/convert_static_utg_to_ui_elements.ts +1 -0
  463. package/i18n/skills/a2h-app-migrate/references/specs.example.json +0 -19
  464. package/i18n/skills/a2h-batch-ui-align/scripts/databinding_analyzer_design.md +0 -79
  465. package/i18n/skills/a2h-utg-explorer/scripts/utg_explorer/state_phase.mjs +0 -47
  466. package/resource/convert_pipeline_process.svg +0 -114
  467. package/resource/project_architecture.svg +0 -120
  468. package/resource/set_environment.png +0 -0
  469. package/resource/set_multimodel.png +0 -0
  470. package/skills/a2h-app-migrate/references/specs.example.json +0 -19
  471. package/skills/a2h-batch-ui-align/scripts/databinding_analyzer_design.md +0 -79
  472. package/skills/a2h-utg-explorer/scripts/utg_explorer/state_phase.mjs +0 -47
@@ -1,6 +1,6 @@
1
1
  ## Example 1: Playlist share code
2
2
 
3
- ```markdown
3
+ ````markdown
4
4
  # Playlist share code SPEC
5
5
 
6
6
  Encode a playlist as a text share code to move it across devices, then decode the share code and import it locally.
@@ -60,12 +60,11 @@ The user imports the same share code more than once, or imports a playlist whose
60
60
  - app/src/main/java/com/melody/musicapp/util/ShareCodeCodec.java:88
61
61
  - app/src/main/java/com/melody/musicapp/util/Crc32Util.java:19
62
62
  - app/src/main/java/com/melody/musicapp/data/repository/PlaylistRepository.java:74
63
- ```
64
- ```
63
+ ````
65
64
 
66
65
  ## Example 2: Add to playlist
67
66
 
68
- ```markdown
67
+ ````markdown
69
68
  # Add to playlist SPEC
70
69
 
71
70
  Users can add one or more songs to a playlist from several entry points; the playlist detail page shows songs under the configured sort rule and adds a "by time added to the playlist" option.
@@ -188,9 +187,17 @@ When songs are added, the client submits the addition to the server; the request
188
187
 
189
188
  - 1. The user adds one or more songs to the target playlist from any entry point, and the page requests the submission while it refreshes the local list
190
189
  - 2. The page sends a `POST https://api.example.com/v1/playlist/songs` request whose header content type is application/json and charset is utf-8
191
- - 3. The request body's `playlistId` and `songIds` are required: `playlistId` is the target playlist's number and `songIds` is the array of song numbers added this time; both are sent on every request
192
- - 4. `source` is not required: entering from the song list, album, artist or folder sends song_list, album, artist or folder respectively, while entering from the playlist detail page sends playlist_detail; when the source cannot be determined the field is not sent — no empty string either
193
- - 5. `position` is not required: when the user specifies no insert position the field is not sent and the server appends under the playlist's current sort rule; it is sent only when the user explicitly drags a song to a position
190
+ - 3. The request body is serialized field by field from the table below and then sent, with the key order following the table's row order and whether a key appears following the `send:` condition:
191
+ ```text
192
+ Add songs request body
193
+ ├─ field:playlistId type/encoding:string default:— send:required
194
+ ├─ field:songIds type/encoding:array<string> default:— send:required
195
+ ├─ field:source type/encoding:string default:"" send:optional, not sent when it equals the default
196
+ └─ field:position type/encoding:int default:-1 send:optional, not sent when it equals the default
197
+ ```
198
+ Value sources: `playlistId` comes from the playlist currently open, and `songIds` from the songs selected this time; `source` is an empty string when there is no entry point, and `position` is -1 when unspecified. Entries carry different fields: `source` comes from the entry point; `position` is carried only when the user explicitly reorders, and **not carried** by other entries (the field does not appear in the request body).
199
+ - 4. `source` takes song_list, album, artist or folder according to the entry point, and playlist_detail when the entry is the playlist detail page
200
+ - 5. When the user explicitly drags a song to a position, `position` carries that position; otherwise the server appends under the playlist's current sort rule
194
201
  - 6. After the response arrives `code` is 0, and the page refreshes the playlist's song count and cover from `data.addedCount`; the addition is complete
195
202
 
196
203
  ## Scenario 8
@@ -203,9 +210,19 @@ When the server returns a business failure, the local append is undone and a fai
203
210
 
204
211
  - 1. The user adds one or more songs to the target playlist from any entry point, and the page requests the submission while it refreshes the local list
205
212
  - 2. The page sends a `POST https://api.example.com/v1/playlist/songs` request whose header content type is application/json and charset is utf-8
206
- - 3. The request body's `playlistId` and `songIds` are required; `source` is not required and is not sent when the source cannot be determined; `position` is not required and is not sent when no insert position is specified
207
- - 4. After the response arrives `code` is not 0, so the page undoes the locally appended songs and restores the playlist's song count and cover to their values before the submission
208
- - 5. The page shows the response's `message`, and the existing playlist data stays unchanged
213
+ - 3. The request body is serialized field by field from the table below and then sent, with the key order following the table's row order and whether a key appears following the `send:` condition:
214
+ ```text
215
+ Add songs request body
216
+ ├─ field:playlistId type/encoding:string default:— send:required
217
+ ├─ field:songIds type/encoding:array<string> default:— send:required
218
+ ├─ field:source type/encoding:string default:"" send:optional, not sent when it equals the default
219
+ └─ field:position type/encoding:int default:-1 send:optional, not sent when it equals the default
220
+ ```
221
+ Value sources: `playlistId` comes from the playlist currently open, and `songIds` from the songs selected this time; `source` is an empty string when there is no entry point, and `position` is -1 when unspecified. Entries carry different fields: `source` comes from the entry point; `position` is carried only when the user explicitly reorders, and **not carried** by other entries (the field does not appear in the request body).
222
+ - 4. `source` takes song_list, album, artist or folder according to the entry point, and playlist_detail when the entry is the playlist detail page
223
+ - 5. When the user specifies no insert position, the server appends under the playlist's current sort rule
224
+ - 6. After the response arrives `code` is not 0, so the page undoes the locally appended songs and restores the playlist's song count and cover to their values before the submission
225
+ - 7. The page shows the response's `message`, and the existing playlist data stays unchanged
209
226
 
210
227
  ## Scenario 9
211
228
 
@@ -266,7 +283,7 @@ The playlist picker must contain every existing playlist and its song informatio
266
283
  ### Scenario Steps
267
284
 
268
285
  - 1. The user triggers the playlist picker through an add-to-playlist action
269
- - 2. The picker lists every existing playlist, and each playlist's song count is accurate
286
+ - 2. The picker lists every existing playlist; each row's song count comes from that playlist's association records in the playlist-song table, counted over distinct song entries (the same song associated twice counts once, songs already removed from the playlist are not counted, and a possibly stale cached count is not used), and is shown to the right of the playlist name
270
287
 
271
288
  ## Scenario 14
272
289
 
@@ -291,52 +308,169 @@ After songs are added to a playlist, the playlist's song count refreshes immedia
291
308
  - app/src/main/java/com/melody/musicapp/data/repository/PlaylistRepository.java:39
292
309
  - app/src/main/java/com/melody/musicapp/data/repository/PlaylistRepository.java:58
293
310
  - app/src/main/java/com/melody/musicapp/data/db/dao/PlaylistSongDao.java:27
294
- ```
295
- ```
311
+ ````
296
312
 
297
- ## Example 3: Data sync
313
+ ## Example 3: Settings page sync and font size
298
314
 
299
- ```markdown
300
- # Data sync SPEC
315
+ ````markdown
316
+ # Settings page sync and font size SPEC
301
317
 
302
- Sync the current business object to the cloud.
318
+ On the "Settings page" the user can report the number of records in the local pending queue to the cloud and, on success, record the sync identifier and the last sync time; the user can also pick a font size level, after which the "Settings page" text follows the new level immediately.
303
319
 
304
320
  ## Scenario 1
305
321
 
306
322
  ### Scenario Overview
307
323
 
308
- When the request is valid and the server returns success, the app sends the request under the business HTTP contract, parses the response, and persists it
324
+ When the request is valid and the server returns success, the app reports the pending record count, writes the sync record from the response, and updates "Last sync time"
309
325
 
310
326
  ### Scenario Steps
311
327
 
312
- - 1. The user taps the "Sync now" button on the "Settings page"
313
- - 2. Send `POST https://api.example.com/v1/sync` with the header `Content-Type: application/json; charset=utf-8`
314
- - 3. Encode the request body as UTF-8 JSON with field order `userId`, `deviceId`, `payload`
315
- - 4. Receive the response and read `code`, `data`, `message`
316
- - 5. When `code=0`, read the sync id from `data.syncId`, write a sync record to local persistence, and keep it across page reentry
317
- - 6. Show the toast "Sync succeeded" and update the "Last sync time" on the "Settings page" to this sync's time
328
+ - 1. The user taps the "Sync now" button on the "Settings page"; the button becomes unavailable until the request finishes, preventing repeated submission
329
+ - 2. The app sends a `POST` request to `https://api.example.com/v1/sync` with the header `Content-Type` set to `application/json` and its charset set to utf-8, and the header `Accept` set to `application/json`; the connect timeout is 10 seconds and the read timeout is 30 seconds
330
+ - 3. The request body is serialized field by field from the table below and then sent, with the key order following the table's row order, no BOM, no trailing newline, and no keys outside the table:
331
+ ```text
332
+ Sync request body
333
+ ├─ field:userId type/encoding:string default:"" send:required, falls back to the default
334
+ ├─ field:deviceId type/encoding:string default:"unknown" send:required, falls back to the default unknown when it cannot be read
335
+ └─ field:payload type/encoding:int default:0 send:optional, not sent when the pending count is 0
336
+ ```
337
+ Value sources: `userId` is the current signed-in user number in local storage, `deviceId` is the device identifier in local storage (generated and written on first run and reused for every later sync), and `payload` is the count of records whose `synced` flag is false in the local pending queue (already-synced records are not counted, and the field is not sent when the count is 0).
338
+ - 4. The app receives the response and reads the envelope fields `code` and `data`, where `data` is an object and `data.syncId` is this sync's identifier; the `message` field of the response is not displayed
339
+ - 5. When `code` is 0, the app writes this sync into the sync record persistence: the key is `lastSyncRecord`, of type object, empty when no record exists; the object contains the two fields `syncId` and `syncTime`, where `syncId` is text holding the `data.syncId` value and `syncTime` is text holding this sync's time in the `yyyy-MM-dd HH:mm` format, fields of `data` other than `syncId` are not written into that record, and the record contains only those two fields; the record is re-read when the page is entered again
340
+ - 6. After a successful sync, the app marks the records in the local pending queue as synced, the pending count becomes 0, and the synced records themselves are kept and not deleted
341
+ - 7. The app shows the toast "Sync succeeded"
342
+ - 8. The app updates "Last sync time" on the "Settings page" to the `syncTime` value
343
+ - 9. When the request finishes, the "Sync now" button becomes available again
318
344
 
319
345
  ## Scenario 2
320
346
 
321
347
  ### Scenario Overview
322
348
 
323
- When the server returns a business failure, the app persists nothing and shows the corresponding message
349
+ When the server returns business failure code 1001 or a 4xx status code, the app persists nothing, keeps the pending queue unchanged, and shows a sync failure
350
+
351
+ ### Scenario Steps
352
+
353
+ - 1. The user taps the "Sync now" button on the "Settings page"; the button becomes unavailable until the request finishes
354
+ - 2. The app sends a `POST` request to `https://api.example.com/v1/sync` with the header `Content-Type` set to `application/json` and its charset set to utf-8, and the header `Accept` set to `application/json`; the connect timeout is 10 seconds and the read timeout is 30 seconds
355
+ - 3. The request body is serialized field by field from the table below and then sent, with the key order following the table's row order, no BOM, no trailing newline, and no keys outside the table:
356
+ ```text
357
+ Sync request body
358
+ ├─ field:userId type/encoding:string default:"" send:required, falls back to the default
359
+ ├─ field:deviceId type/encoding:string default:"unknown" send:required, falls back to the default unknown when it cannot be read
360
+ └─ field:payload type/encoding:int default:0 send:optional, not sent when the pending count is 0
361
+ ```
362
+ Value sources: `userId` is the current signed-in user number in local storage, `deviceId` is the device identifier in local storage (generated and written on first run and reused for every later sync), and `payload` is the count of records whose `synced` flag is false in the local pending queue (already-synced records are not counted, and the field is not sent when the count is 0).
363
+ - 4. The app receives the response and reads the envelope field `code`; `data` is not read and the `message` field of the response is not displayed
364
+ - 5. When `code` is 1001, the app writes nothing into the sync record persistence `lastSyncRecord`, and that record keeps its original value
365
+ - 6. "Last sync time" on the "Settings page" keeps its original value
366
+ - 7. The local pending queue and the pending count stay unchanged, and no record is marked as synced
367
+ - 8. The app shows the toast "Sync failed, try again later"
368
+ - 9. A response status code from 400 to 499 is not retried and produces the same failure result: nothing is written into `lastSyncRecord`, the last sync time keeps its original value, the pending queue stays unchanged, and the toast "Sync failed, try again later" is shown
369
+ - 10. Any other non-zero `code` is also not retried and produces the same failure result: nothing is written into `lastSyncRecord`, the last sync time keeps its original value, the pending queue stays unchanged, and the toast "Sync failed, try again later" is shown
370
+ - 11. When the request finishes, the "Sync now" button becomes available again
371
+
372
+ ## Scenario 3
373
+
374
+ ### Scenario Overview
375
+
376
+ When the first sync request hits a retryable failure, the app retries after 2 seconds and then after 4 seconds, and a successful retry writes the sync record and reports sync success
377
+
378
+ ### Scenario Steps
379
+
380
+ - 1. The user taps the "Sync now" button on the "Settings page"; the button becomes unavailable until the request finishes
381
+ - 2. The app sends a `POST` request to `https://api.example.com/v1/sync` with the header `Content-Type` set to `application/json` and its charset set to utf-8, and the header `Accept` set to `application/json`; the connect timeout is 10 seconds and the read timeout is 30 seconds
382
+ - 3. The request body is serialized field by field from the table below and then sent, with the key order following the table's row order, no BOM, no trailing newline, and no keys outside the table:
383
+ ```text
384
+ Sync request body
385
+ ├─ field:userId type/encoding:string default:"" send:required, falls back to the default
386
+ ├─ field:deviceId type/encoding:string default:"unknown" send:required, falls back to the default unknown when it cannot be read
387
+ └─ field:payload type/encoding:int default:0 send:optional, not sent when the pending count is 0
388
+ ```
389
+ Value sources: `userId` is the current signed-in user number in local storage, `deviceId` is the device identifier in local storage (generated and written on first run and reused for every later sync), and `payload` is the count of records whose `synced` flag is false in the local pending queue (already-synced records are not counted, and the field is not sent when the count is 0).
390
+ - 4. A connect timeout, a read timeout, an unavailable network, or a response status code from 500 to 599 is treated as a retryable failure; after the first request fails the app waits 2 seconds and sends the first retry, and if that retry also fails it waits 4 seconds and sends the second retry; at most 2 retries are made
391
+ - 5. While retrying, the "Sync now" button stays unavailable and the page shows no prompt
392
+ - 6. The first retry or the second retry returns a response whose `code` is 0; the app reads the envelope field `data`, where `data` is an object and `data.syncId` is this sync's identifier
393
+ - 7. The app writes this sync into the sync record persistence: the key is `lastSyncRecord`, of type object, empty when no record exists; the object contains the two fields `syncId` and `syncTime`, where `syncId` is text holding the `data.syncId` value and `syncTime` is text holding this sync's time in the `yyyy-MM-dd HH:mm` format, fields of `data` other than `syncId` are not written into that record, and the record contains only those two fields
394
+ - 8. The app marks the records in the local pending queue as synced, the pending count becomes 0, and the synced records themselves are kept and not deleted
395
+ - 9. The app shows the toast "Sync succeeded" and updates "Last sync time" on the "Settings page" to the `syncTime` value
396
+ - 10. When the request finishes, the "Sync now" button becomes available again
397
+
398
+ ## Scenario 4
399
+
400
+ ### Scenario Overview
401
+
402
+ When the sync request keeps hitting retryable failures, the app retries after 2 seconds and then after 4 seconds, and when both retries fail it applies the failure result while the sync record and the pending queue keep their original values
403
+
404
+ ### Scenario Steps
405
+
406
+ - 1. The user taps the "Sync now" button on the "Settings page"; the button becomes unavailable until the request finishes
407
+ - 2. The app sends a `POST` request to `https://api.example.com/v1/sync` with the header `Content-Type` set to `application/json` and its charset set to utf-8, and the header `Accept` set to `application/json`; the connect timeout is 10 seconds and the read timeout is 30 seconds
408
+ - 3. The request body is serialized field by field from the table below and then sent, with the key order following the table's row order, no BOM, no trailing newline, and no keys outside the table:
409
+ ```text
410
+ Sync request body
411
+ ├─ field:userId type/encoding:string default:"" send:required, falls back to the default
412
+ ├─ field:deviceId type/encoding:string default:"unknown" send:required, falls back to the default unknown when it cannot be read
413
+ └─ field:payload type/encoding:int default:0 send:optional, not sent when the pending count is 0
414
+ ```
415
+ Value sources: `userId` is the current signed-in user number in local storage, `deviceId` is the device identifier in local storage (generated and written on first run and reused for every later sync), and `payload` is the count of records whose `synced` flag is false in the local pending queue (already-synced records are not counted, and the field is not sent when the count is 0).
416
+ - 4. A connect timeout, a read timeout, an unavailable network, or a response status code from 500 to 599 is treated as a retryable failure; a non-success status code outside 500 to 599, and a business failure with a non-zero `code`, are not retried
417
+ - 5. When the first request is judged retryable, the app waits 2 seconds and sends the first retry, and if the first retry also fails it waits 4 seconds and sends the second retry; at most 2 retries are made, that is at most 3 requests in total
418
+ - 6. Every retry re-sends the same request body; while retrying, the "Sync now" button stays unavailable and the page shows no prompt
419
+ - 7. When both retries have failed, the app applies the failure result: nothing is written into `lastSyncRecord`, "Last sync time" keeps its original value, and the local pending queue and pending count stay unchanged
420
+ - 8. The app shows the toast "Sync failed, try again later"
421
+ - 9. When the request finishes, the "Sync now" button becomes available again, and the next tap starts counting again from the first request
422
+
423
+ ## Scenario 5
424
+
425
+ ### Scenario Overview
426
+
427
+ After the user picks a font size level on the "Settings page", the level is written to local storage and part of the "Settings page" text immediately re-renders at the new level
428
+
429
+ ### Scenario Steps
430
+
431
+ - 1. The user taps the "Font size" setting item on the "Settings page"; the "Font size" selector dialog opens and lists the three levels "Standard", "Large", and "Extra large" in order, with the currently effective level shown as selected
432
+ - 2. The preview text "Settings text sample" inside the dialog is shown at the currently selected level
433
+ - 3. The user taps the "Large" level, and the preview text immediately changes to the "Large" level
434
+ - 4. The user taps "OK", and the font size level is written to local storage under the key `fontScale`, of type text, defaulting to `standard`, with the full value set `standard` (Standard), `large` (Large), and `xlarge` (Extra large)
435
+ - 5. On the "Settings page", the "Account and security" group title, the "Font size" setting item title, the "Font size" setting item description, and the "Last sync time" label immediately re-render at the "Large" level
436
+ - 6. The current level text shown by the "Font size" setting item updates to "Large", and the "Font size" selector dialog closes
437
+ - 7. The remaining pages re-read `fontScale` the next time they become visible
438
+
439
+ ## Scenario 6
440
+
441
+ ### Scenario Overview
442
+
443
+ When the "Settings page" is entered with an existing sync record, "Last sync time" shows the time of the last successful sync
324
444
 
325
445
  ### Scenario Steps
326
446
 
327
- - 1. The user taps the "Sync now" button on the "Settings page"
328
- - 2. Send the request with the same headers, field order, and encoding as Scenario 1
329
- - 3. Receive the response and read `code`, `message`
330
- - 4. When `code=1001`, do not read `data`, write no sync record to local persistence, and keep the "Last sync time" at its original value
331
- - 5. Show the toast "Sync failed, try again later"
447
+ - 1. The user enters the "Settings page"
448
+ - 2. The page reads the sync record persistence `lastSyncRecord`, an object containing the two text fields `syncId` and `syncTime`, where `syncTime` is the time of the last successful sync
449
+ - 3. "Last sync time" on the "Settings page" shows the record's `syncTime` value in the `yyyy-MM-dd HH:mm` format
450
+
451
+ ## Scenario 7
452
+
453
+ ### Scenario Overview
454
+
455
+ When the "Settings page" is entered without any successful sync, "Last sync time" shows "Never synced"
456
+
457
+ ### Scenario Steps
458
+
459
+ - 1. The user enters the "Settings page" without any earlier successful sync
460
+ - 2. The page reads the sync record persistence `lastSyncRecord`; the key does not exist and the record is empty
461
+ - 3. "Last sync time" on the "Settings page" shows "Never synced"
332
462
 
333
463
  ## Android Code Reference
334
464
 
335
465
  - app/src/main/java/com/melody/musicapp/ui/fragment/SettingsFragment.java:61
466
+ - app/src/main/java/com/melody/musicapp/ui/fragment/SettingsFragment.java:88
467
+ - app/src/main/java/com/melody/musicapp/ui/dialog/FontScaleDialog.java:33
336
468
  - app/src/main/java/com/melody/musicapp/network/SyncApi.java:28
337
469
  - app/src/main/java/com/melody/musicapp/network/SyncApi.java:44
338
470
  - app/src/main/java/com/melody/musicapp/network/SyncRequestBody.java:22
471
+ - app/src/main/java/com/melody/musicapp/network/RetryInterceptor.java:27
339
472
  - app/src/main/java/com/melody/musicapp/data/repository/SyncRepository.java:47
340
473
  - app/src/main/java/com/melody/musicapp/data/repository/SyncRepository.java:63
341
- ```
342
- ```
474
+ - app/src/main/java/com/melody/musicapp/data/repository/SettingsRepository.java:31
475
+ - app/src/main/java/com/melody/musicapp/util/FontScaleApplier.java:25
476
+ ````
@@ -87,7 +87,7 @@ Percent encoding is **reversible** (`%` itself becomes `%25`, and the encoded re
87
87
  | `summary` | At least 40 words, in one paragraph | G6 |
88
88
  | `scenarios[].title` | Non-empty; one line; there is no character or word minimum | — |
89
89
  | `scenarios[].steps[]` | At least one step; each step carries at least 5 words; the renderer adds `- N. ` | G6 |
90
- | `coverage.edges/widgets/interactions` | Their union covers the evidence slice, or uncovered items go in `excluded`; **every item must include `by_scenario` (a valid 1-based index into `scenarios[]`)** | G4 |
90
+ | `coverage.edges/widgets/interactions` | Their union covers the evidence slice, or uncovered items go in `excluded`; **every item must include `by_scenario` (a valid 1-based index into `scenarios[]`)**. An `edges` item may add `claim_token` when the derived token would be meaningless (Compose route, overlay name); the supplied token is matched exactly (case-insensitively) in that scenario's steps | G4 |
91
91
  | `discovery_digest` | Behavior-enabled draft binding to the page discovery entry; must equal the pre-audit and post-review page digest | G4 |
92
92
  | `scenarios[].contracts.endpoints[].operation_id/branch/state_version` | Audit-only operation link and scenario branch/state-version metadata; each operation and branch/state-version projection must have a matching `operation_reviews` entry and a field disposition consistent with `params`. None is rendered or merged into the steps as a fact token | G2/G4 |
93
93
  | `coverage.behaviors[]` | Explicit assertion links: one per planned assertion, with valid 1-based scenario/step indices or a legal waiver/unknown reason | G4 |
@@ -105,16 +105,18 @@ Percent encoding is **reversible** (`%` itself becomes `%25`, and the encoded re
105
105
 
106
106
  | kind | Contents | Written into the steps as |
107
107
  |---|---|---|
108
- | `endpoints` | `operation_id` / `branch` / `state_version` (audit-only) / `name` / `method` / `url` / `params[]` (`in`∈`query`\|`path`\|`header`\|`body`, `name` / `type` / `required` / `default` / `source` / `note`) / `response_fields[]` / `timeouts[]` / `note` | The request step: method, complete URL, every parameter name with its type, required flag, default and value source, and for a non-required parameter the condition under which it is not sent, every response field, and timeouts; `operation_id`, `branch`, and `state_version` are not rendered |
108
+ | `endpoints` | `operation_id` / `branch` / `state_version` (audit-only) / `name` / `method` / `url` / `params[]` (`in`∈`query`\|`path`\|`header`\|`body`, `name` / `type` / `required` / `default` / `source` / `note`) / `response_fields[]` / `timeouts[]` / `note` | The request step: method, complete URL, request headers and timeouts; the body as a field table whose rows carry four labels (`field:` / `type/encoding:` / `default:` / `send:`) plus a value-source line for fields not fed by this page's input; every response field. `operation_id`, `branch`, and `state_version` are not rendered |
109
109
  | `stores` | `name` / `key` / `type` / `default` / `values[]` (strings or `{value, label}`) / `note` | The persistence step: key name, type, default, and every enum value — never "etc." |
110
110
  | `entities` | `name` / `fields[]` (`name` / `type` / `nullable` / `unit` / `note`) / `note` | The display or computation step: the entity's business name and every field with its type, nullability, and unit |
111
- | `rules` | `name` / `statement` | The step that performs the conversion or applies the boundary: an instruction that can be followed verbatim |
111
+ | `rules` | `name` / `statement` | The step that performs the conversion or applies the boundary: an instruction that can be followed verbatim, carrying every numeric value the rule can be wrong about (a coefficient, an offset, a threshold, an enum value) |
112
112
 
113
113
  **Request and response keys are written key by key.** A parameter's default and value source belong in its `default` and `source` fields (`default: 0`, `source: local storage`) and are merged into the request step; a nested key keeps its path in `name` (`data.list[].id`); a non-required parameter also states in its `note` when it is absent from the wire (e.g. “equals its default, so the request body omits it”) or that it is always sent with its default (“always sent, uses the default value”), and the request step carries that rule too so the coder does not turn a default value into a sent key; `response_fields[]` lists one field path per string (`current_temperature`, `hourly.temperatures[]`), while the envelope (code/data/message), types, nullability and missing-value handling go into the entry's `note` and the step text. An endpoint or parameter field outside the lists above, or a non-string `response_fields[]` item, is rejected by G2 because the fact base cannot carry it.
114
114
 
115
+ **The request body is a field table inside the request step.** Every row carries four labelled segments in a fixed order — `field:`, `type/encoding:`, `default:`, `send:` — and the table is a top-level fenced block whose row order is the serialization key order. The send segment starts with `required` (always present), `optional` (may be absent) or `never` (never present), followed by a decidable condition such as “, not sent when it equals the default 0”; a plain `required` means a missing source value is a defect, while “, falls back to the default” means the default fills it. A value-source line follows the table for every field not fed by this page's input. Each row must also be declared in `params[]` with `in: "body"`: the path goes after `field:` (`a.b` nested, `a[].b` for an array element), the type matches the table token verbatim, and the default/source hold the same values. A table row missing from `params[]`, or a `params[]` entry missing from the table, is reported by G2 as a fact that never reached the steps. See `scenario-authoring.md`, “Request Bodies and Responses”, for the complete rule.
116
+
115
117
  **The body language rules apply to the merged steps.** Contract-only syntax is no longer legal anywhere: no `dp`/`sp`/`px`/`dip` (with or without a number), no `#hex`, no `key=value` (write "the code field is 1001"), no framework type names, no `file:line`. Visual values are rewritten as business descriptions ("the size is large"). Data values keep their source spelling (`maxRows`, `countryName`, `temperaturePrefs`, `kmh`) because the coder must use the same names. A value the body rules forbid verbatim (`600dp`, `#FF5733`, `timezone=auto`, a framework type) is therefore rewritten, and G2 does not require it token by token.
116
118
 
117
- **Rule statements are the one gap.** A free-form `rules[].statement` cannot be matched token by token, so the gate checks every other kind and the reviewer checks rule statements against the steps. See [gates.md](gates.md).
119
+ **Rule prose is checked by its numbers.** A free-form `rules[].statement` cannot be matched word by word, so G2 checks its numeric literals instead: every value the rule can be wrong about must appear in the consuming step, in the shape the step states it (grouping, sign and exponent are normalized), while a literal that only describes how a value is printed — a zero-padded field width, a decimal-place count — is skipped. Rule prose without Arabic numerals stays a review item. See [gates.md](gates.md).
118
120
 
119
121
  **If there is no content, omit the scenario's `contracts` entirely; do not add empty arrays as filler.** At the scenario level, `{}`, `[]`, and empty kind arrays are treated as absent. At the page level the field is not supported at all, and any declared container is a G2 error — `{"endpoints": []}` is a declaration, not silence.
120
122
 
@@ -169,7 +171,7 @@ that token never appears in a SPEC or `specs.json`.
169
171
 
170
172
  ### 2.1 Complete Example
171
173
 
172
- Read `references/spec-example.md` for three complete per-page SPECs (playlist share code, add to playlist, data sync). Each one is wrapped in a Markdown fence and follows every rendering rule in §2.2.
174
+ Read `references/spec-example.md` for three complete per-page SPECs (playlist share code, add to playlist, settings page sync and font size). Each one is wrapped in a Markdown fence and follows every rendering rule in §2.2.
173
175
 
174
176
  ### 2.2 Rendering Rules
175
177
 
@@ -178,6 +180,7 @@ Rendering rules (`scripts/render.mjs`, deterministic):
178
180
  - The H1 is always `# <title> SPEC`—**there is one space before `SPEC`**.
179
181
  - Scenario headings are always `## Scenario <N>` (one space after `##`, a digit after `Scenario`), ensuring that `countScenarios` matches them.
180
182
  - Steps always use `- 1. ` / `- 2. ` numbering, one step per item. Implementation facts are already merged into the consuming steps; the renderer prints `steps` verbatim and never appends a contract section.
183
+ - A step may carry a fenced code block (the request-body field table); the block's row order defines the serialization key order.
181
184
  - `## Android Code Reference` is always the final section, with one `- <file:line>` per entry.
182
185
  - Do not produce a `Deviations from Requirement` section.
183
186
  - The filename is `<title>-SPEC.md` (characters in `title` that are unsuitable for filenames are replaced with `-`). Note that downstream `specTitle` comes from the H1 (after trimming, `<title> SPEC`, preserving the space in the middle), while `spec_stem` comes from the filename (`<title>-SPEC`). They differ only in the separator and do not need to be aligned.
@@ -36,6 +36,18 @@ const nonEmpty = value => typeof value === "string" && value.trim() !== "";
36
36
  const same = (a, b) => stableDigest(a) === stableDigest(b);
37
37
  const fail = (code, message, extra = {}) => ({ code, message, ...extra });
38
38
 
39
+ /** Producer-reserved unknowns may never be closed by a worker resolution. */
40
+ function producerReservedIds({ evidence, discovery }) {
41
+ if (evidence?.profile?.resolution_policy !== "producer-reserved-v1") return new Set();
42
+ const ids = new Set();
43
+ for (const unknown of [...asArray(evidence?.unknowns), ...asArray(discovery?.unknowns)]) {
44
+ if (unknown?.reason === "review-incomplete"
45
+ && ["source-unit-limit", "contract-call-deferred", "contract-evidence-limit"].includes(unknown?.cause)
46
+ && nonEmpty(unknown.id)) ids.add(unknown.id);
47
+ }
48
+ return ids;
49
+ }
50
+
39
51
  export { evidenceSnapshotDigest } from "./behavior-model.mjs";
40
52
 
41
53
  /**
@@ -401,7 +413,9 @@ function checkEvidenceReferences({ evidence, discovery, sourceProject, reconcile
401
413
  const dispositions = new Map(objectEntries(discovery.planned).map(entry => [entry.assertion_id, entry]));
402
414
  const reviews = new Map(objectEntries(discovery.evidence_reviews).map(entry => [entry.assertion_id, entry]));
403
415
  const resolutions = asArray(discovery.resolutions);
416
+ const reservedIds = producerReservedIds({ evidence, discovery });
404
417
  const resolutionAccounts = assertionId => resolutions.some(resolution => {
418
+ if (reservedIds.has(resolution?.unknown_id)) return false;
405
419
  if (resolution?.status !== "resolved") return false;
406
420
  if (!asArray(resolution.assertion_ids).includes(assertionId)) return false;
407
421
  const refs = assertableRefs(resolution.evidence_refs);
@@ -443,6 +457,7 @@ function checkUnknownReferences({ evidence, discovery, sourceProject }) {
443
457
  }
444
458
  }
445
459
  for (const resolution of asArray(discovery.resolutions)) {
460
+ if (producerReservedIds({ evidence, discovery }).has(resolution?.unknown_id)) continue;
446
461
  for (const reference of assertableRefs(resolution?.evidence_refs)) {
447
462
  const state = referenceState({ reference, evidence, sourceProject });
448
463
  if (state.status !== "valid") {
@@ -506,7 +521,9 @@ function hasIncompleteReviews({ evidence, discovery }) {
506
521
  for (const disposition of asArray(discovery.candidate_dispositions)) {
507
522
  if (disposition?.review_status !== undefined && disposition.review_status !== "reviewed") return true;
508
523
  }
524
+ const reservedIds = producerReservedIds({ evidence, discovery });
509
525
  for (const resolution of asArray(discovery.resolutions)) {
526
+ if (reservedIds.has(resolution?.unknown_id)) continue;
510
527
  if (resolution?.review_status === "incomplete") return true;
511
528
  }
512
529
  return false;
@@ -586,6 +603,7 @@ export function evaluatePreAudit({ plan, evidence, discovery, sourceProject, inc
586
603
  return {
587
604
  status,
588
605
  failures,
606
+ ...(asArray(reconciled.diagnostics).length > 0 ? { diagnostics: reconciled.diagnostics } : {}),
589
607
  unknowns: unresolvedUnknowns,
590
608
  dispositions: asArray(doc.planned),
591
609
  discovery_digest: stableDigest(doc),
@@ -728,7 +746,9 @@ function placeholderPageState({ preAudit, failures }) {
728
746
  }
729
747
 
730
748
  function resolutionAccounts({ assertionId, discovery, evidence, sourceProject }) {
749
+ const reservedIds = producerReservedIds({ evidence, discovery });
731
750
  return asArray(discovery.resolutions).some(resolution => {
751
+ if (reservedIds.has(resolution?.unknown_id)) return false;
732
752
  if (resolution?.status !== "resolved") return false;
733
753
  if (!asArray(resolution.assertion_ids).includes(assertionId)) return false;
734
754
  const refs = assertableRefs(resolution.evidence_refs);
@@ -1819,6 +1839,7 @@ export function evaluateBehaviorGroup({
1819
1839
  if (behaviorPages.length === 0) return null;
1820
1840
 
1821
1841
  const failures = [];
1842
+ const warnings = [];
1822
1843
  const pageResults = {};
1823
1844
  let state = null;
1824
1845
  let ledgerError = null;
@@ -2102,6 +2123,17 @@ export function evaluateBehaviorGroup({
2102
2123
  { spec_id: pageSpecIdsFor(pageId)[0] ?? null });
2103
2124
  failures.push(failure);
2104
2125
  }
2126
+ for (const diagnostic of asArray(pagePre?.diagnostics)) {
2127
+ if (!nonEmpty(diagnostic?.code)) continue;
2128
+ warnings.push({
2129
+ gate: "G4",
2130
+ page_id: pageId,
2131
+ spec_id: pageSpecIdsFor(pageId)[0] ?? null,
2132
+ code: diagnostic.code,
2133
+ unknown_id: diagnostic.unknown_id ?? null,
2134
+ message: diagnostic.message ?? "",
2135
+ });
2136
+ }
2105
2137
 
2106
2138
  let pagePost;
2107
2139
  if (post !== undefined) {
@@ -2212,6 +2244,9 @@ export function evaluateBehaviorGroup({
2212
2244
  return {
2213
2245
  status,
2214
2246
  failures,
2247
+ warnings: warnings.sort((left, right) =>
2248
+ `${left.code}\u0000${left.unknown_id ?? ""}` < `${right.code}\u0000${right.unknown_id ?? ""}` ? -1
2249
+ : `${left.code}\u0000${left.unknown_id ?? ""}` > `${right.code}\u0000${right.unknown_id ?? ""}` ? 1 : 0),
2215
2250
  pages: pageResults,
2216
2251
  counts,
2217
2252
  discovery_digest: groupDigest,
@@ -2304,11 +2339,12 @@ const BEHAVIOR_EVIDENCE_FILES = Object.freeze([
2304
2339
  "candidates.json",
2305
2340
  "assertions.json",
2306
2341
  "unknowns.json",
2342
+ "contracts.json",
2307
2343
  ]);
2308
2344
 
2309
2345
  /**
2310
2346
  * Collect the submission/commit fence for immutable evidence and the
2311
- * attempt-scoped audit artifacts. The four fixed evidence files of every
2347
+ * attempt-scoped audit artifacts. The five fixed evidence files of every
2312
2348
  * behavior page are always present in the map: a file missing at collection
2313
2349
  * time is recorded as `null` so a later appearance is a conflict rather than a
2314
2350
  * newly discovered expected artifact.