@buaa_smat/hometrans 0.1.16 → 0.1.19
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 +162 -54
- package/agents/code-reviewer.md +321 -65
- package/agents/logic-coder.md +113 -88
- package/agents/logic-context-builder.md +47 -29
- package/agents/scripts/hmos-precheck/backends/arkts.mjs +567 -0
- package/agents/scripts/hmos-precheck/backends/arkts_diff.mjs +159 -0
- package/agents/scripts/hmos-precheck/backends/arkts_project_rules.mjs +398 -0
- package/agents/scripts/hmos-precheck/backends/codelinter.mjs +250 -0
- package/agents/scripts/hmos-precheck/backends/project_integrity.mjs +321 -0
- package/agents/scripts/hmos-precheck/backends/static_precheck.mjs +247 -0
- package/agents/scripts/hmos-precheck/core/config.mjs +184 -0
- package/agents/scripts/hmos-precheck/core/diagnostic_scope.mjs +20 -0
- package/agents/scripts/hmos-precheck/core/process_adapter.mjs +47 -0
- package/agents/scripts/hmos-precheck/core/project_catalog.mjs +50 -0
- package/agents/scripts/hmos-precheck/core/result_projection.mjs +147 -0
- package/agents/scripts/hmos-precheck/core/scope_plan.mjs +131 -0
- package/agents/scripts/hmos-precheck/core/sdk_context.mjs +67 -0
- package/agents/scripts/hmos-precheck/docs/architecture.md +37 -0
- package/agents/scripts/hmos-precheck/docs/performance-optimization.md +28 -0
- package/agents/scripts/hmos-precheck/docs/upstream-reference.json +19 -0
- package/agents/scripts/hmos-precheck/docs/validation.md +50 -0
- package/agents/scripts/hmos-precheck/index.mjs +17 -0
- package/agents/scripts/hmos-precheck/invocation.mjs +231 -0
- package/agents/scripts/hmos-precheck/rules/rule_case_matrix.csv +32 -0
- package/agents/scripts/hmos-precheck/rules/rule_inventory.csv +64 -0
- package/agents/scripts/hmos-precheck/rules/rule_inventory.mjs +59 -0
- package/agents/scripts/hmos-precheck/rules/rule_policy.mjs +54 -0
- package/agents/scripts/platform_query.mjs +626 -0
- package/agents/scripts/platform_query.test.mjs +422 -0
- package/agents/self-test-fixer.md +36 -34
- package/agents/self-tester.md +123 -143
- package/agents/test-case-generation-generator.md +317 -0
- package/agents/test-case-generation-validator.md +231 -0
- package/dist/cli/config-store.js +16 -63
- package/dist/cli/env-vars.js +1 -3
- package/dist/cli/index.js +0 -11
- package/dist/cli/init.js +127 -144
- package/dist/cli/uninstall.js +76 -110
- package/dist/utils/regex.js +8 -0
- package/env-requirements.json +55 -54
- package/package.json +6 -6
- package/resource/convert_pipeline_process.svg +103 -0
- package/resource/project_architecture.svg +122 -0
- package/resource/title_dark.png +0 -0
- package/skills/hmos-batch-ui-align/SKILL.md +345 -41
- package/skills/hmos-batch-ui-align/references/conversion-procedure.md +661 -180
- package/skills/hmos-batch-ui-align/references/mappings/android-to-harmonyOS-ui-atomic-component-mapping-reference.md +2533 -2533
- package/skills/hmos-batch-ui-align/references/mappings/android-to-harmonyOS-ui-interaction-mapping-reference.md +555 -555
- package/skills/hmos-batch-ui-align/references/mappings/android-to-harmonyOS-ui-layout-mapping-reference.md +117 -117
- package/skills/hmos-batch-ui-align/references/mvvm/@Link/350/243/205/351/245/260/345/231/250/357/274/232/347/210/266/345/255/220/345/217/214/345/220/221/345/220/214/346/255/245.md +648 -648
- package/skills/hmos-batch-ui-align/references/mvvm/@Observed/350/243/205/351/245/260/345/231/250/345/222/214@ObjectLink/350/243/205/351/245/260/345/231/250/357/274/232/345/265/214/345/245/227/347/261/273/345/257/271/350/261/241/345/261/236/346/200/247/345/217/230/345/214/226.md +2088 -2088
- package/skills/hmos-batch-ui-align/references/mvvm/@Prop/350/243/205/351/245/260/345/231/250/357/274/232/347/210/266/345/255/220/345/215/225/345/220/221/345/220/214/346/255/245.md +1033 -1033
- package/skills/hmos-batch-ui-align/references/mvvm/@Provide/350/243/205/351/245/260/345/231/250/345/222/214@Consume/350/243/205/351/245/260/345/231/250/357/274/232/344/270/216/345/220/216/344/273/243/347/273/204/344/273/266/345/217/214/345/220/221/345/220/214/346/255/245.md +1183 -1183
- package/skills/hmos-batch-ui-align/references/mvvm/@State/350/243/205/351/245/260/345/231/250/357/274/232/347/273/204/344/273/266/345/206/205/347/212/266/346/200/201.md +576 -576
- package/skills/hmos-batch-ui-align/references/mvvm/@Track/350/243/205/351/245/260/345/231/250/357/274/232class/345/257/271/350/261/241/345/261/236/346/200/247/347/272/247/346/233/264/346/226/260.md +297 -297
- package/skills/hmos-batch-ui-align/references/mvvm/@Watch/350/243/205/351/245/260/345/231/250/357/274/232/347/212/266/346/200/201/345/217/230/351/207/217/346/233/264/346/224/271/351/200/232/347/237/245.md +395 -395
- package/skills/hmos-batch-ui-align/references/mvvm/AppStorage/357/274/232/345/272/224/347/224/250/345/205/250/345/261/200/347/232/204UI/347/212/266/346/200/201/345/255/230/345/202/250.md +902 -902
- package/skills/hmos-batch-ui-align/references/mvvm/Environment/357/274/232/350/256/276/345/244/207/347/216/257/345/242/203/346/237/245/350/257/242.md +106 -106
- package/skills/hmos-batch-ui-align/references/mvvm/LocalStorage/357/274/232/351/241/265/351/235/242/347/272/247UI/347/212/266/346/200/201/345/255/230/345/202/250.md +1178 -1178
- package/skills/hmos-batch-ui-align/references/mvvm/MVVM/346/250/241/345/274/217/357/274/210V1/357/274/211.md +911 -911
- package/skills/hmos-batch-ui-align/references/mvvm/PersistentStorage/357/274/232/346/214/201/344/271/205/345/214/226/345/255/230/345/202/250UI/347/212/266/346/200/201.md +354 -354
- package/skills/hmos-batch-ui-align/references/mvvm//347/256/241/347/220/206/345/272/224/347/224/250/346/213/245/346/234/211/347/232/204/347/212/266/346/200/201/346/246/202/350/277/260.md +11 -11
- package/skills/hmos-batch-ui-align/references/mvvm-v2/!!/350/257/255/346/263/225/357/274/232/345/217/214/345/220/221/347/273/221/345/256/232.md +206 -0
- package/skills/hmos-batch-ui-align/references/mvvm-v2/@Computed/350/243/205/351/245/260/345/231/250/357/274/232/350/256/241/347/256/227/345/261/236/346/200/247.md +373 -0
- package/skills/hmos-batch-ui-align/references/mvvm-v2/@Event/350/243/205/351/245/260/345/231/250/357/274/232/350/247/204/350/214/203/347/273/204/344/273/266/350/276/223/345/207/272.md +158 -0
- package/skills/hmos-batch-ui-align/references/mvvm-v2/@Local/350/243/205/351/245/260/345/231/250/357/274/232/347/273/204/344/273/266/345/206/205/351/203/250/347/212/266/346/200/201.md +750 -0
- package/skills/hmos-batch-ui-align/references/mvvm-v2/@Monitor/350/243/205/351/245/260/345/231/250/357/274/232/347/212/266/346/200/201/345/217/230/351/207/217/344/277/256/346/224/271/345/274/202/346/255/245/347/233/221/345/220/254.md +1704 -0
- package/skills/hmos-batch-ui-align/references/mvvm-v2/@ObservedV2/350/243/205/351/245/260/345/231/250/345/222/214@Trace/350/243/205/351/245/260/345/231/250/357/274/232/347/261/273/345/261/236/346/200/247/345/217/230/345/214/226/350/247/202/346/265/213.md +1012 -0
- package/skills/hmos-batch-ui-align/references/mvvm-v2/@Once/350/243/205/351/245/260/345/231/250/357/274/232/345/210/235/345/247/213/345/214/226/345/220/214/346/255/245/344/270/200/346/254/241.md +164 -0
- package/skills/hmos-batch-ui-align/references/mvvm-v2/@Param/350/243/205/351/245/260/345/231/250/357/274/232/347/273/204/344/273/266/345/244/226/351/203/250/350/276/223/345/205/245.md +840 -0
- package/skills/hmos-batch-ui-align/references/mvvm-v2/@Provider/350/243/205/351/245/260/345/231/250/345/222/214@Consumer/350/243/205/351/245/260/345/231/250/357/274/232/350/267/250/347/273/204/344/273/266/345/261/202/347/272/247/345/217/214/345/220/221/345/220/214/346/255/245.md +856 -0
- package/skills/hmos-batch-ui-align/references/mvvm-v2/@Type/350/243/205/351/245/260/345/231/250/357/274/232/346/240/207/350/256/260/347/261/273/345/261/236/346/200/247/347/232/204/347/261/273/345/236/213.md +83 -0
- package/skills/hmos-batch-ui-align/references/mvvm-v2/AppStorageV2/357/274/232/345/272/224/347/224/250/345/205/250/345/261/200UI/347/212/266/346/200/201/345/255/230/345/202/250.md +294 -0
- package/skills/hmos-batch-ui-align/references/mvvm-v2/MVVM/346/250/241/345/274/217/357/274/210V2/357/274/211.md +1407 -0
- package/skills/hmos-batch-ui-align/references/mvvm-v2/PersistenceV2/357/274/232/346/214/201/344/271/205/345/214/226/345/255/230/345/202/250UI/347/212/266/346/200/201.md +1220 -0
- package/skills/hmos-batch-ui-align/references/mvvm-v2/_/350/214/203/345/274/217/351/200/211/346/213/251/350/257/264/346/230/216.md +47 -0
- package/skills/hmos-batch-ui-align/references/mvvm-v2/_/350/243/205/351/245/260/345/231/250/351/200/237/346/237/245.md +133 -0
- package/skills/hmos-batch-ui-align/references/mvvm-v2//347/212/266/346/200/201/347/256/241/347/220/206V1/345/220/221V2/350/277/201/347/247/273/344/270/216/346/267/267/347/224/250/346/214/207/345/257/274.md +840 -0
- package/skills/hmos-batch-ui-align/scripts/android_parse_fast.ts +1798 -0
- package/skills/hmos-batch-ui-align/scripts/arkts_static_check.ts +1592 -0
- package/skills/hmos-batch-ui-align/scripts/measure_pack.ts +752 -0
- package/skills/hmos-convert-pipeline/SKILL.md +168 -121
- package/skills/hmos-fix-build-errors/SKILL.md +87 -67
- package/skills/hmos-fix-build-errors/references/arkts-strict-patterns.md +219 -219
- package/skills/hmos-fix-build-errors/references/known-patterns.md +157 -157
- package/skills/hmos-fix-build-errors/references/rdb-entity-pattern.md +131 -131
- package/skills/hmos-incremental-ui-align/README.md +53 -36
- package/skills/hmos-incremental-ui-align/SKILL.md +179 -23
- package/skills/hmos-incremental-ui-align/diff_analysis.md +52 -52
- package/skills/hmos-incremental-ui-align/page_align.md +62 -62
- package/skills/hmos-incremental-ui-align/references/Comparison_Template.md +38 -2
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/@Link/350/243/205/351/245/260/345/231/250/357/274/232/347/210/266/345/255/220/345/217/214/345/220/221/345/220/214/346/255/245.md +648 -648
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/@Observed/350/243/205/351/245/260/345/231/250/345/222/214@ObjectLink/350/243/205/351/245/260/345/231/250/357/274/232/345/265/214/345/245/227/347/261/273/345/257/271/350/261/241/345/261/236/346/200/247/345/217/230/345/214/226.md +2088 -2088
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/@Prop/350/243/205/351/245/260/345/231/250/357/274/232/347/210/266/345/255/220/345/215/225/345/220/221/345/220/214/346/255/245.md +1033 -1033
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/@Provide/350/243/205/351/245/260/345/231/250/345/222/214@Consume/350/243/205/351/245/260/345/231/250/357/274/232/344/270/216/345/220/216/344/273/243/347/273/204/344/273/266/345/217/214/345/220/221/345/220/214/346/255/245.md +1183 -1183
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/@State/350/243/205/351/245/260/345/231/250/357/274/232/347/273/204/344/273/266/345/206/205/347/212/266/346/200/201.md +576 -576
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/@Track/350/243/205/351/245/260/345/231/250/357/274/232class/345/257/271/350/261/241/345/261/236/346/200/247/347/272/247/346/233/264/346/226/260.md +297 -297
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/@Watch/350/243/205/351/245/260/345/231/250/357/274/232/347/212/266/346/200/201/345/217/230/351/207/217/346/233/264/346/224/271/351/200/232/347/237/245.md +395 -395
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/AppStorage/357/274/232/345/272/224/347/224/250/345/205/250/345/261/200/347/232/204UI/347/212/266/346/200/201/345/255/230/345/202/250.md +902 -902
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/Environment/357/274/232/350/256/276/345/244/207/347/216/257/345/242/203/346/237/245/350/257/242.md +106 -106
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/LocalStorage/357/274/232/351/241/265/351/235/242/347/272/247UI/347/212/266/346/200/201/345/255/230/345/202/250.md +1178 -1178
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/MVVM/346/250/241/345/274/217V1.md +911 -911
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243/PersistentStorage/357/274/232/346/214/201/344/271/205/345/214/226/345/255/230/345/202/250UI/347/212/266/346/200/201.md +354 -354
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243//347/256/241/347/220/206/345/272/224/347/224/250/346/213/245/346/234/211/347/232/204/347/212/266/346/200/201/346/246/202/350/277/260.md +11 -11
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/!!/350/257/255/346/263/225/357/274/232/345/217/214/345/220/221/347/273/221/345/256/232.md +206 -0
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/@Computed/350/243/205/351/245/260/345/231/250/357/274/232/350/256/241/347/256/227/345/261/236/346/200/247.md +373 -0
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/@Event/350/243/205/351/245/260/345/231/250/357/274/232/350/247/204/350/214/203/347/273/204/344/273/266/350/276/223/345/207/272.md +158 -0
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/@Local/350/243/205/351/245/260/345/231/250/357/274/232/347/273/204/344/273/266/345/206/205/351/203/250/347/212/266/346/200/201.md +750 -0
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/@Monitor/350/243/205/351/245/260/345/231/250/357/274/232/347/212/266/346/200/201/345/217/230/351/207/217/344/277/256/346/224/271/345/274/202/346/255/245/347/233/221/345/220/254.md +1704 -0
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/@ObservedV2/350/243/205/351/245/260/345/231/250/345/222/214@Trace/350/243/205/351/245/260/345/231/250/357/274/232/347/261/273/345/261/236/346/200/247/345/217/230/345/214/226/350/247/202/346/265/213.md +1012 -0
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/@Once/350/243/205/351/245/260/345/231/250/357/274/232/345/210/235/345/247/213/345/214/226/345/220/214/346/255/245/344/270/200/346/254/241.md +164 -0
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/@Param/350/243/205/351/245/260/345/231/250/357/274/232/347/273/204/344/273/266/345/244/226/351/203/250/350/276/223/345/205/245.md +840 -0
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/@Provider/350/243/205/351/245/260/345/231/250/345/222/214@Consumer/350/243/205/351/245/260/345/231/250/357/274/232/350/267/250/347/273/204/344/273/266/345/261/202/347/272/247/345/217/214/345/220/221/345/220/214/346/255/245.md +856 -0
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/@Type/350/243/205/351/245/260/345/231/250/357/274/232/346/240/207/350/256/260/347/261/273/345/261/236/346/200/247/347/232/204/347/261/273/345/236/213.md +83 -0
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/AppStorageV2/357/274/232/345/272/224/347/224/250/345/205/250/345/261/200UI/347/212/266/346/200/201/345/255/230/345/202/250.md +294 -0
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/MVVM/346/250/241/345/274/217/357/274/210V2/357/274/211.md +1407 -0
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/PersistenceV2/357/274/232/346/214/201/344/271/205/345/214/226/345/255/230/345/202/250UI/347/212/266/346/200/201.md +1220 -0
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2/_/350/214/203/345/274/217/351/200/211/346/213/251/350/257/264/346/230/216.md +47 -0
- package/skills/hmos-incremental-ui-align/references/MVVM/345/274/200/345/217/221/346/226/207/346/241/243V2//347/212/266/346/200/201/347/256/241/347/220/206V1/345/220/221V2/350/277/201/347/247/273/344/270/216/346/267/267/347/224/250/346/214/207/345/257/274.md +840 -0
- package/skills/hmos-incremental-ui-align/references/State_Model_Template.md +74 -0
- package/skills/hmos-incremental-ui-align/references/UI_Analysis_Template.md +34 -4
- package/skills/hmos-incremental-ui-align/references/android-to-harmonyOS-ui-atomic-component-mapping-reference.md +2533 -2533
- package/skills/hmos-incremental-ui-align/references/android-to-harmonyOS-ui-interaction-mapping-reference.md +555 -555
- package/skills/hmos-incremental-ui-align/references/android-to-harmonyOS-ui-layout-mapping-reference.md +117 -117
- package/skills/hmos-incremental-ui-align/scripts/app_feature_verify.ts +937 -0
- package/skills/hmos-incremental-ui-align/scripts/extract_checklist.ts +343 -0
- package/skills/hmos-incremental-ui-align/scripts/navigation-capure.md +44 -5
- package/skills/hmos-incremental-ui-align/scripts/page_capture.ts +977 -0
- package/skills/hmos-incremental-ui-align/scripts/page_capture_burst.ts +188 -0
- package/skills/hmos-integration-test/README.md +61 -70
- package/skills/hmos-integration-test/SKILL.md +128 -111
- package/skills/hmos-resources-convert/SKILL.md +334 -66
- package/skills/hmos-resources-convert/references/code-vector-icon-rules.md +335 -0
- package/skills/hmos-resources-convert/references/conversion-rules.md +676 -663
- package/skills/hmos-resources-convert/references/dependency-analysis-rules.md +410 -388
- package/skills/hmos-resources-convert/references/lottie-conversion-rules.md +219 -0
- package/skills/hmos-resources-convert/references/resource-mapping-rules.md +482 -457
- package/skills/hmos-resources-convert/references/xml-drawable-to-svg-rules.md +592 -513
- package/skills/hmos-resources-convert/scripts/a2h_resource_convert.ts +2163 -0
- package/skills/hmos-resources-convert/scripts/code_vector_icons.ts +591 -0
- package/skills/hmos-resources-convert/scripts/svg_fidelity_check.ts +632 -0
- package/skills/hmos-spec-generate/SKILL.md +293 -214
- package/skills/hmos-spec-generate/scripts/parse_requirements.ts +515 -0
- package/skills/hmos-spec-generate/template/REQ.txt +22 -0
- package/skills/hmos-spec-generate/template/REQ.xlsx +0 -0
- package/skills/hmos-test-case-generation/README.md +241 -0
- package/skills/hmos-test-case-generation/SKILL.md +324 -0
- package/skills/hmos-test-case-generation/references/contract.md +315 -0
- package/skills/hmos-test-case-generation/references/review-notes-template.md +84 -0
- package/skills/hmos-test-case-generation/references/ui-elements-schema.md +142 -0
- package/skills/hmos-test-case-generation/tools/convert_to_ui_elements.ts +550 -0
- package/skills/hmos-test-case-generation/tools/validate.ts +1312 -0
- package/tools/bfs-crawl/README.md +73 -0
- package/tools/bfs-crawl/android_viewtree_bfs_crawler.ts +1662 -0
- package/tools/test-tools/autotest/config.ts +175 -0
- package/tools/test-tools/autotest/deps/autotest-agent-0.1.1.tgz +0 -0
- package/tools/test-tools/autotest/docs/README.md +266 -0
- package/tools/test-tools/autotest/{testcases_schema.md → docs/testcases_schema.md} +1 -1
- package/tools/test-tools/autotest/engine/batch-launcher.ts +327 -0
- package/tools/test-tools/autotest/engine/report-tool.ts +773 -0
- package/tools/test-tools/autotest/engine/self-test-runner.ts +961 -0
- package/tools/test-tools/autotest/engine/testcases-tool.ts +246 -0
- package/tools/test-tools/autotest/paths.ts +41 -0
- package/tools/test-tools/autotest/resolve-metadata-tool.ts +143 -0
- package/tools/test-tools/autotest/runner/logger.ts +45 -0
- package/tools/test-tools/autotest/runner/process-utils.ts +41 -0
- package/tools/test-tools/autotest/validate.ts +167 -0
- package/agents/build-fixer.md +0 -385
- package/agents/logic-coder/scripts/platform_context_query.py +0 -568
- package/agents/review-fixer.md +0 -405
- package/agents/spec-generator.md +0 -541
- package/dist/cli/mcp-setup.js +0 -258
- package/dist/cli/mcp.js +0 -94
- package/dist/context/index.js +0 -694
- package/resource/migration_process.svg +0 -94
- package/resource/migration_process_transparent.svg +0 -93
- package/skills/hmos-batch-ui-align/scripts/android_parse_fast.py +0 -1606
- package/skills/hmos-incremental-ui-align/scripts/__pycache__/app_feature_verify.cpython-314.pyc +0 -0
- package/skills/hmos-incremental-ui-align/scripts/app_feature_verify.py +0 -542
- package/skills/hmos-incremental-ui-align/scripts/page_capture.py +0 -597
- package/skills/hmos-resources-convert/evals/evals.json +0 -171
- package/skills/hmos-resources-convert/template/AppScope/app.json5 +0 -10
- package/skills/hmos-resources-convert/template/AppScope/resources/base/element/string.json +0 -8
- package/skills/hmos-resources-convert/template/AppScope/resources/base/media/background.png +0 -0
- package/skills/hmos-resources-convert/template/AppScope/resources/base/media/foreground.png +0 -0
- package/skills/hmos-resources-convert/template/AppScope/resources/base/media/layered_image.json +0 -7
- package/skills/hmos-resources-convert/template/build-profile.json5 +0 -42
- package/skills/hmos-resources-convert/template/code-linter.json5 +0 -32
- package/skills/hmos-resources-convert/template/entry/build-profile.json5 +0 -33
- package/skills/hmos-resources-convert/template/entry/hvigorfile.ts +0 -6
- package/skills/hmos-resources-convert/template/entry/obfuscation-rules.txt +0 -23
- package/skills/hmos-resources-convert/template/entry/oh-package.json5 +0 -10
- package/skills/hmos-resources-convert/template/entry/src/main/ets/entryability/EntryAbility.ets +0 -48
- package/skills/hmos-resources-convert/template/entry/src/main/ets/entrybackupability/EntryBackupAbility.ets +0 -16
- package/skills/hmos-resources-convert/template/entry/src/main/ets/pages/Index.ets +0 -23
- package/skills/hmos-resources-convert/template/entry/src/main/module.json5 +0 -55
- package/skills/hmos-resources-convert/template/entry/src/main/resources/base/element/color.json +0 -8
- package/skills/hmos-resources-convert/template/entry/src/main/resources/base/element/float.json +0 -8
- package/skills/hmos-resources-convert/template/entry/src/main/resources/base/element/string.json +0 -16
- package/skills/hmos-resources-convert/template/entry/src/main/resources/base/media/background.png +0 -0
- package/skills/hmos-resources-convert/template/entry/src/main/resources/base/media/foreground.png +0 -0
- package/skills/hmos-resources-convert/template/entry/src/main/resources/base/media/layered_image.json +0 -7
- package/skills/hmos-resources-convert/template/entry/src/main/resources/base/media/startIcon.png +0 -0
- package/skills/hmos-resources-convert/template/entry/src/main/resources/base/profile/backup_config.json +0 -3
- package/skills/hmos-resources-convert/template/entry/src/main/resources/base/profile/main_pages.json +0 -5
- package/skills/hmos-resources-convert/template/entry/src/main/resources/dark/element/color.json +0 -8
- package/skills/hmos-resources-convert/template/entry/src/mock/mock-config.json5 +0 -2
- package/skills/hmos-resources-convert/template/entry/src/ohosTest/ets/test/Ability.test.ets +0 -35
- package/skills/hmos-resources-convert/template/entry/src/ohosTest/ets/test/List.test.ets +0 -5
- package/skills/hmos-resources-convert/template/entry/src/ohosTest/module.json5 +0 -16
- package/skills/hmos-resources-convert/template/entry/src/test/List.test.ets +0 -5
- package/skills/hmos-resources-convert/template/entry/src/test/LocalUnit.test.ets +0 -33
- package/skills/hmos-resources-convert/template/hvigor/hvigor-config.json5 +0 -23
- package/skills/hmos-resources-convert/template/hvigorfile.ts +0 -6
- package/skills/hmos-resources-convert/template/oh-package-lock.json5 +0 -28
- package/skills/hmos-resources-convert/template/oh-package.json5 +0 -10
- package/skills/hmos-resources-convert/tools/apktool.bat +0 -85
- package/skills/hmos-resources-convert/tools/apktool_3.0.1.jar +0 -0
- package/skills/hmos-spec-generate/references/android-platform-tokens.md +0 -105
- package/skills/hmos-spec-generate/references/spec-sample-1.md +0 -78
- package/skills/hmos-spec-generate/references/spec-sample-2.md +0 -58
- package/skills/hmos-spec-generate/references/spec-sample-3.md +0 -116
- package/skills/hmos-spec-generate/references/step4-report-template.md +0 -33
- package/tools/test-tools/autotest/README.md +0 -238
- package/tools/test-tools/autotest/pyproject.toml +0 -26
- package/tools/test-tools/autotest/report_tool.py +0 -759
- package/tools/test-tools/autotest/self_test_runner.py +0 -895
- package/tools/test-tools/autotest/testcases_tool.py +0 -215
- package/tools/test-tools/autotest/uv.lock +0 -3156
- package/tools/test-tools/harmony_autotest-0.1.0-py3-none-any.whl +0 -0
- package/tools/test-tools/hypium-6.1.0.210-py3-none-any.whl +0 -0
- package/tools/test-tools/hypium_mcp-0.6.5-py3-none-any.whl +0 -0
- package/tools/test-tools/xdevice-6.1.0.210-py3-none-any.whl +0 -0
- package/tools/test-tools/xdevice_devicetest-6.1.0.210-py3-none-any.whl +0 -0
- package/tools/test-tools/xdevice_ohos-6.1.0.210-py3-none-any.whl +0 -0
|
@@ -0,0 +1,317 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: test-case-generation-generator
|
|
3
|
+
description: "TCG generation body (S2+S3). Claims a batch of scenarios (1~several, merged working set ≤ context window) dispatched by the orchestrator, does branch derivation within each scenario (with bookkeeping), page-rotates to cut out the minimal working set, generates test cases with embedded four-honesty evidence, and writes directly to test_case.md (no longer writes scenarios.json). Only generates, does not self-check."
|
|
4
|
+
mode: subagent
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# test-case-generation-generator
|
|
8
|
+
|
|
9
|
+
**Only generates, does not self-check.** You produce test cases and their evidence but **do not judge your own correctness** — checking evidence is the job of S4 (`tools/validate.ts`) and S5 (`test-case-generation-validator`). Before writing, read `references/contract.md` §3 and emit exactly the field formats and enums defined there.
|
|
10
|
+
|
|
11
|
+
**Responsibility boundary = S2 + S3**:
|
|
12
|
+
- Scenario enumeration (S1), budget-based batching, and global finalization (S6) are the orchestrator's job, **not yours**.
|
|
13
|
+
- Each time you only handle **a batch of scenarios** dispatched by the orchestrator (it has already guaranteed the merged working set ≤ context window).
|
|
14
|
+
- Within each scenario, do branch derivation (boundary/exception/multi-entry/parametrized/pairwise expansion) with bookkeeping. **Never discover new scenarios yourself** — missing scenario splits are upstream spec defects, outside your red line.
|
|
15
|
+
|
|
16
|
+
**Zero CS jargon rule (must obey)**: No academic jargon (no certifying / witness / certificate / TypedGap / proof-carrying / Hoare / TCB etc.); do not write or read `scenarios.json`; **prefer the real app name from the input spec / ui_elements; when no real name is available, write the placeholder 「被测应用」** (do not fabricate specific brand names like 「悦音」), and log a review_notes todo "app name unknown, placeholder to be replaced" — the downstream self-tester will replace it wholesale with the real bundleName from the AppScope of the project under test (`打开 被测应用` → `打开 <bundleName>`), so the placeholder just needs to be generic and easy to spot. Use the real field set 「前置条件 / 动作 / 预期结果 / 测试点」.
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
20
|
+
## Input / Output
|
|
21
|
+
|
|
22
|
+
### Input
|
|
23
|
+
|
|
24
|
+
| Parameter | Required | Description |
|
|
25
|
+
|---|---|---|
|
|
26
|
+
| `scenes` | Yes | A **batch of scenarios** (1~several) dispatched by the orchestrator. Each scenario contains `scene_id` + overview span + step span (or their locator in spec). The orchestrator has already roughly estimated the merged working set ≤ context window. |
|
|
27
|
+
| `spec-path` | Yes | `<feature>-SPEC.md`, used to look up the span original text (`## 场景N` = `### 场景概述` + `### 场景逻辑步骤`). **The only authoritative base**. |
|
|
28
|
+
| `ui-elements-path` | No | `ui_elements.json`. **Soft reference**: not guaranteed accurate, may be missing; when missing, the relevant soft-check positions are empty and action grounding relies on spec text + industry common terms. **Never treat as a hard gate**. |
|
|
29
|
+
| `references-dir` | No | External reference package: operation definitions / page descriptions / templates / reusable precondition case library / special test data / "allowed default precondition checklist". Soft reference; when missing, relevant reuse opportunities disappear but the flow continues. |
|
|
30
|
+
| `contract-path` | Yes | `references/contract.md`, the single source of truth for field formats + 7 hard constraints + enumerations. |
|
|
31
|
+
| `output-path` | Yes | Clean delivery directory where `test_case.md` / `pre_test_case.md` / `review_notes.md` are written. Process reports and BFS dumps live in the orchestrator's separate `{output-path}.work/` directory. |
|
|
32
|
+
| `mode` | No | Default = normal generation; `repair` = same-page rewrite (see the last section "repair mode"). |
|
|
33
|
+
| `report` | No | Brought when `mode: repair`: `cases-report.json` (S4 FAIL) or validator's FAIL verdict, naming the fields. |
|
|
34
|
+
|
|
35
|
+
### Output
|
|
36
|
+
|
|
37
|
+
Written to `{output-path}/`:
|
|
38
|
+
|
|
39
|
+
| File | Required | Content |
|
|
40
|
+
|---|---|---|
|
|
41
|
+
| `test_case.md` | Yes | Test cases for this batch of scenarios (each scenario's base + derived branches), **with embedded four-honesty evidence**; what cannot be done is written as a `[SKIP: <reason>]` record. Format see contract §3.1 / §3.2. |
|
|
42
|
+
| `pre_test_case.md` | No | Produced when a case's precondition is marked "see precondition case" and needs the cumulative state externalized into a precondition sequence (see S3 step 4 "precondition state externalization"); otherwise not produced. |
|
|
43
|
+
| `review_notes.md` (**single human companion document**, containing blocking area + non-blocking area) | Yes | Wraps `references/review-notes-template.md`. **Produce only this one file; blocking area on top, non-blocking area below; never start a separate `manual-intervention.md`** (merging is a hard constraint; producing both files at once will be judged FAIL by validate.ts's `manual_intervention_forbidden` / `companion_not_merged`). You fill only what **your own batch** produces: blocking area (cross-app / white-box SKIP, special data that must be constructed first, empty-state execution-order exceptions, etc.) + non-blocking area (stub-implementation / deviation background knowledge items: this part is currently a stub, will fail when run, line numbers here, the runner decides whether to delete; pruning / sampling / downgrade bookkeeping; todos outside `## 场景来源映射` that need to be seen by humans). **The validator's semantic validation verdict is not yours to write** — it merges into the same file itself. Both areas fold when empty: the blocking area is omitted entirely (header included) when it has no content; within each present area, collapse empty categories as entire sections. The file itself is always emitted. |
|
|
44
|
+
|
|
45
|
+
> **You do not produce**: `scenarios.json` (deleted), any `_internal/` machine artifacts, cases-report.json (that's produced by validate.ts), validator verdict.
|
|
46
|
+
|
|
47
|
+
**Accumulation rule (critical)**: normal generation for batch 2+ performs a **targeted incremental edit**, not a historical reread. Locate only the insertion boundaries of `## 编号映射表` / `## 场景来源映射`, existing Scenario ids, relevant `pre_test_case.md` segment ids/names/resource names, and the relevant `review_notes.md` section; do not load earlier Scenario bodies into the working set. Insert this batch's ledger rows, append its Scenario blocks and pre-test segments, and place its review notes inside the matching blocking/non-blocking section while leaving earlier text untouched. Never replace an accumulated file with a batch-only file. Repairs follow the narrower rules at the end of this document.
|
|
48
|
+
|
|
49
|
+
---
|
|
50
|
+
|
|
51
|
+
## Overall flow (S2 page-rotate to cut working set → S3 per-intent write test case; branch derivation inlined within scenario)
|
|
52
|
+
|
|
53
|
+
Entry: received `scenes` = a batch of scenarios, each containing one base intent.
|
|
54
|
+
|
|
55
|
+
1. **S2**: For this batch, cut out the **minimal working set WS** (only load the materials this batch needs; roughly estimate text volume < safe fraction of context window).
|
|
56
|
+
2. **S3**: Traverse "each scenario's base intent + the branch sub-intents fished out according to derivation discipline within that scenario"; for each intent, write **one** Scenario in the real format per contract §3, or write **one** `[SKIP: <reason>]` record; maintain file-level `## 编号映射表`, and for reworked/derived ones also record `## 场景来源映射`; produce a `case_signature` for each and hang it into the resident ledger.
|
|
57
|
+
3. Hand back when done writing, **do not self-check, do not run validate.ts, do not self-endorse**.
|
|
58
|
+
|
|
59
|
+
The two steps below are explained as followable steps.
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
## S2 — Page rotation · Cut working set (only load what this batch needs)
|
|
64
|
+
|
|
65
|
+
Goal: assemble **the materials actually needed to write this batch of test cases** into the working set WS, roughly estimate text volume < **safe fraction** (default about 50%, leaving half for output + reasoning + slack) of the model context window CTX. **Don't stuff the entire SPEC / the whole element table in** — that's the whole point of S2, and the carrier of the "one intent at a time" cost discipline.
|
|
66
|
+
|
|
67
|
+
### 2.1 Bounded BFS along references, fish out element subset
|
|
68
|
+
|
|
69
|
+
WS = this batch's each scenario's span ∪ element subset hit by BFS along references ∪ hit templates/references. Specifically:
|
|
70
|
+
|
|
71
|
+
1. **Seed** = the "scenario overview span + scenario logic step span" original text of each scenario in this batch (go back to `spec-path` to read).
|
|
72
|
+
2. **First hop** (if `ui_elements.json` exists): take the page/element names mentioned in the scenario steps, look up the corresponding entries in `pages[]` / `elements[]` / `flows[]`, **take only the hit ones**, together with the pages directly referenced by them (both ends of `flows[]` edges).
|
|
73
|
+
3. **Second hop**: for the intermediate pages / edges needed to complete the navigation path (see S3 step 2 "navigation completion"), take one more hop.
|
|
74
|
+
4. **Templates/references** (if `references-dir` exists): use action intent to look up the reusable precondition case library / operation definitions / page descriptions, **take only hits**.
|
|
75
|
+
5. **Stop**: BFS depth to 2 hops (navigation usually only differs by one or two hops); deeper means this batch is too large, go to 2.3.
|
|
76
|
+
|
|
77
|
+
**Don't stuff**: pages not mentioned in this batch, SPEC sections unrelated to this batch, the entire element table. Better to take less and go back to `spec-path` when you find something missing than to stuff everything in first.
|
|
78
|
+
|
|
79
|
+
### 2.2 Rough estimate whether over window
|
|
80
|
+
|
|
81
|
+
Roughly add up the character count of WS (scenario span character count + hit element entry count × rough per-entry character count). **Don't precisely count tokens**, just order-of-magnitude judgment:
|
|
82
|
+
- Estimate < CTX × safe fraction → continue S3.
|
|
83
|
+
- Estimate ≥ safe fraction → go to 2.3.
|
|
84
|
+
|
|
85
|
+
> The orchestrator has already roughly estimated batching, but it only looks at "scenario span characters + roughly hit element count", which may be inaccurate. Here is the real fallback: you compare the actually assembled materials against the window.
|
|
86
|
+
|
|
87
|
+
### 2.3 Over-window fallback (truncate by reference distance, keep books; single intent still over → SKIP)
|
|
88
|
+
|
|
89
|
+
1. **Truncate if possible**: by reference distance, chop from the farthest (second-hop completion pages, lowest-hit references) inward until the estimate drops below the safe fraction. **Record each chop** in `review_notes` (reviewable: what was chopped, why, which scenarios affected). After truncation, proceed with S3 as usual.
|
|
90
|
+
2. **Nothing left to chop**: if chopping down to only **a single intent's own span** still exceeds the window (an extremely long single-scenario step), this intent cannot be faithfully written within the window → write it a `[SKIP: 上下文超窗]` record (SKIP reason enumeration see contract §3.3, `上下文超窗` is one of them), declaring what the expected result should be + to whom it's handed back. **Do not silently drop**.
|
|
91
|
+
|
|
92
|
+
---
|
|
93
|
+
|
|
94
|
+
## S3 — Per-intent test case generation (within WS)
|
|
95
|
+
|
|
96
|
+
Traverse all intents in this batch = ⋃ (each scenario's base intent + branch sub-intents derived within that scenario). For **each** intent, do the 7 steps below, producing **exactly one** Scenario or **exactly one** SKIP record.
|
|
97
|
+
|
|
98
|
+
> **One intent at a time / prevent flavor-mixing (cost discipline, self-enforce)**: when writing each one, **focus only on its own single intent**. Even if several scenarios are merged into this batch, **never mix other scenarios' steps/expected results into the current one**. "One intent at a time" = focus on each one when writing each one, **not** "only one scenario can be fed at a time". (The validator only logs a non-blocking suspicion when it finds obvious "mixing other scenarios' materials in".)
|
|
99
|
+
|
|
100
|
+
### Step 1 — Determine intent source, reserve number and mapping first (sourced #1)
|
|
101
|
+
|
|
102
|
+
1. Assign this case number `N-M` (N = the index of that SPEC/scenario group, M = intra-group index, increasing from 1).
|
|
103
|
+
2. Register the function ↔ its corresponding SPEC number in the file-level **`## 编号映射表`** (function ↔ SPEC ↔ REQ) (the SPEC number must really exist in `spec-path` — hanging a non-existent function is unqualified). Mapping table format see contract §3.1.
|
|
104
|
+
3. If this is a base intent (directly present in the scenario text) → do not mark `[推导]`, priority is set in step 5 below.
|
|
105
|
+
4. If this is a derived branch → mark `[推导]`, and **also record `## 场景来源映射`** (case ↔ spec scenario ↔ delta): write clearly which base scenario it derives from, the **derivation type** (see "Derivation types" below), the derivation basis (literal trigger word / overview semantics), and what changed from the base case. `[推导]` cases **must** have a corresponding bookkeeping entry in `## 场景来源映射` or `review_notes` (S4 does not check this — whether the derivation is correct and its bookkeeping is complete is the validator's semantic call). Prefer delta wording like `类型=多入口; 触发=「或在...」; 变化=从歌单列表入口新建`.
|
|
106
|
+
5. **Folding a branch instead of opening it (contract §3.3 「折叠记账」)**: when a branch is **not** opened as its own Scenario but its observable result is **folded into another case's TP** (typically a cluster of "存在→显示实值" fields co-occurring in one popup, covered by one observation), you **must**: (a) ensure the target case carries a concrete TP asserting **that branch's** observable result — **prefer a merged TP** bundling several co-occurring "存在" fields into one「非空/显示真实值」assertion (split into 2-3 TPs when the fields span ≥3 functional sections, for diagnosability); (b) add a ledger row whose `用例` column = `(折叠)<分支简名>` and delta = `去向=fold:N-M#TP-k; 触发=「<verbatim SPEC sentence>」` pointing at that TP. **Empty folding is forbidden** — never fold a branch into prose without landing a TP. **Never write `折叠进` / `折叠入` / `folded into` in review_notes / test_case**: folding lives only in the `去向=fold:` ledger row. validate.ts bounces both halves mechanically — `md` catches the prose literals (`prose_fold_claim`), and `cases` catches a `fold:` pointer to a missing Scenario/TP (`fold_target_scenario_missing` / `fold_target_tp_missing`); whether the TP is semantically good enough is the validator's call.
|
|
107
|
+
|
|
108
|
+
### Step 2 — Write "action", force it into "that's it" (traceable #3)
|
|
109
|
+
|
|
110
|
+
Land the action on concrete objects so that someone who doesn't understand the requirements can follow it. Use concrete object names for each step, format see contract §3.1 (`- 动作:打开 {app} -> ... -> ...`). Grounding priority:
|
|
111
|
+
|
|
112
|
+
1. **Hit template, copy verbatim**: if `references-dir`'s reusable precondition case library / operation definitions hit this action intent, **reuse its steps verbatim**, skip the rest. Record a hit in review_notes (common prefixes can be aggregated in the "common operation prefix" area of review_notes).
|
|
113
|
+
2. **Spec already concrete, keep**: scenario steps already written to concrete objects, keep. **Exception**: vague navigation verbs (`进入{页面}` / `打开{页面}` / `跳转{页面}` without specific trigger elements) **do not count as concrete**, hand to step 3 navigation completion.
|
|
114
|
+
3. **Ground via ui_elements (use if present, trust tiered)**: look up the copy of hit elements, replace generalized operations with concrete UI operations. By **trust tiered soft-downgrade**:
|
|
115
|
+
- **Runtime original text (highest)**: elements from view-tree (copy is captured from real device) → **adopt verbatim** `「{文案}」`, skip the downgrade chain, **never tag** (this is first-hand truth).
|
|
116
|
+
- **Industry common terms (high)**: generic UI words like album/song/list/button/settings/back/cancel/confirm/search/menu/dialog → directly use the translated `「{文案}」`.
|
|
117
|
+
- **English control names always translated to Chinese (app under test is a Chinese interface)**: ui_elements is extracted from the **Android original**, control names are often English (`START SCAN` / `DONE` / `SCAN`…), but the HarmonyOS app under test is a **Chinese interface** — when grounding **use Chinese equivalents** (`START SCAN`→开始扫描、`DONE`→完成、`SCAN`→扫描), **never copy English literals into the case**. Generic operation words with clear Chinese equivalents directly use Chinese, no need to go through the fallback below.
|
|
118
|
+
- **Low confidence**: domain-specific proper nouns / polysemous words / English proper nouns without clear Chinese equivalents → downgrade chain: ① first check templates; ② if the spec text literally writes that copy, use the spec's (no tag); ③ none → **position fallback** (e.g., "click the create button at the bottom of the dialog"), and record this step in review_notes (to confirm: position fallback phrase / original translation / source element; for human confirmation).
|
|
119
|
+
- **No ui_elements**: write the whole case by spec text + industry common terms, skip soft comparison.
|
|
120
|
+
4. **Navigation completion** (vague navigation verbs):
|
|
121
|
+
- Parse `(start page, target page)`, find shortest path on `flows[]`, land each edge as one step.
|
|
122
|
+
- Maintain a `current_page` cursor while writing the action chain. An object-name hit is valid only when that object belongs to `current_page.elements[]`; the same name on an unrelated page is not evidence. Advance `current_page` only through the matching `flows[]` edge.
|
|
123
|
+
- An element proves only that the control was observed. Use an outgoing flow only when it exists; otherwise do not append a dialog, destination page, or intermediate operation after that control.
|
|
124
|
+
- Parent node unresolvable → record `review_notes` "navigation gap", **never fabricate**, keep the spec's original wording.
|
|
125
|
+
- Breakpoint-state completion: if not connected, complete from the target page's precondition (e.g., the player page needs to be playing → add "click {song} in the song list to start playing"), record one entry in review_notes.
|
|
126
|
+
- Skip navigation completion when there's no ui_elements, keep the spec's original wording.
|
|
127
|
+
5. **"Randomly pick one / click the Nth" is legal**, as long as that TP **doesn't care which one**. If the TP **cares** (it will be referenced later) → first "note the selected item (denote as song X)" in the action for TP to reference. Anti-patterns (pure ordinal / absolute coordinates / dynamic copy that drifts with data volume) are judged by the validator; you avoid them as much as possible.
|
|
128
|
+
6. **Boundary value concretization**: vague/range words in actions must be replaced with executable concrete values (spec says "name too long" → you write "input a name of 150 characters"; "exceeds 100 characters" → "105 characters"; "no more than 100" → "99 characters" or "50 characters"; "several/multiple" → "3 items total"). Range expressions can be kept in expected results (that's judgment logic), **actions and preconditions must not leave range/vague words**.
|
|
129
|
+
7. **Wait steps keep only business durations**: UI sync waits in actions like "wait for toast / wait for page jump to complete / wait for loading to complete" **without specific duration** → **delete this step** (connect past with `->`). Those with numeric durations ("play continuously for 60 seconds") or business time points ("natural end / playback finished / total NN%") → **keep**.
|
|
130
|
+
8. **No platform jargon / no source-code references (all fields, not just action)**: no field (action/expected/TP/precondition) contains code tokens like `Activity` / `Fragment` / `Composable` / control class names, **nor source-code filenames + line numbers** (like `MainPageModel.ets:139-141`). test_case.md is a black-box product; source-code references are white-box evidence — they should only appear as background knowledge items in the **non-blocking area** of review_notes (aligns with §2.5; stub/deviation status and code line numbers all belong to the non-blocking area; the blocking area only contains items that block execution/true-judgment). The spec's `> [偏差]` status accounts often carry code line numbers; **when moving the expected behavior, leave the code references in the spec, don't bring them into the case**. validate.ts mechanically scans `code_ref_in_field`, FAIL if present.
|
|
131
|
+
|
|
132
|
+
### Step 3 — Write "preconditions" and triage-tag them (precondition #7)
|
|
133
|
+
|
|
134
|
+
Write each precondition as `- 条件K: …(<tag>)` using a tag from the closed enum in contract §3.3. Choose the tag as follows:
|
|
135
|
+
|
|
136
|
+
- Default environment preconditions (installed, authorized) → `(AutoTest 自动处理)`.
|
|
137
|
+
- **In-app cumulative-state preconditions** (semantic completion "already X / after X / X configured"; needs ≥3 UI operations; or reusable across scenarios, such as "already scanned N songs into library", "already created a playlist with M songs", "already accumulated K play history entries") → tag `(见前置用例)`, **remove the preparation steps from actions**, and externalize them into `pre_test_case.md` (how to externalize, how to collapse into segments by the resource-reuse principle, see "S3 Step 4 — precondition state externalization" below). Assemble the operation chain naturally from SPEC + applicable references + page-local `ui_elements`; do not add operations that none of these sources describe. Missing downstream UI information does not change this classification and must not turn ordinary in-app setup into special test data.
|
|
138
|
+
- **Non-cumulative, lightweight preconditions** ("a song is playing") → tag `(已下沉到测试步骤)`, leave ≤2 preparation steps in actions.
|
|
139
|
+
- **Special data that needs construction** (preset about N playlists to trigger the upper limit; device files that must exist before an in-app scan) → tag `(特殊测试数据)`, and write the required fixture into the **blocking area** of `review_notes.md` (single companion document, no separate manual-intervention.md).
|
|
140
|
+
|
|
141
|
+
### Step 4 — Precondition state externalization (write pre_test_case.md, wrap standard segment format + resource-reuse principle)
|
|
142
|
+
|
|
143
|
+
All cumulative-state preconditions tagged `(见前置用例)` in step 3 must be externalized into `pre_test_case.md`. Read contract §4, follow its segment format and resource-reuse rules, then collapse the required cumulative states into as few compatible segments as possible:
|
|
144
|
+
|
|
145
|
+
1. **First triage by the three resource-reuse classes in contract §4**, classifying all "see precondition case" preconditions:
|
|
146
|
+
- **Class 1 (non-destructive, cumulative, only-read-referenced by multiple cases)**: scan-in songs, baseline read-only playlists, empty baseline playlist → merge into one set of **cumulative shared fixtures** (segment 1 scan songs, segment 2 build all baseline playlists at once, segment 3 fill members into read-only playlists), **do not open a separate segment for each case that references it**. **Read-only baselines deduplicate by "state", not by "role"**: the same read-only state (empty playlist / contains N songs) is built only once; another read-only case needing the same state reuses it (an always-empty baseline serves both as a sort baseline and as an empty-content-page baseline; don't build another one just because the role differs); **only read-only baselines that are never modified can be reused; never reuse any playlist that will be modified by some case; if unsure, build fresh per Class 2**. See contract §4.
|
|
147
|
+
- **Class 2 (mutation cases that change counts / delete)**: the assertion itself is a database migration (song count 0→1 / 0→3 / 3→2 / add again keep 1 / new N→N+1 / cancel keep N) → that case **uses its own fresh neutrally-named playlist** (name unique and neutral, e.g., "测试歌单N"; use is distinguished by segment name, not baked into data name), do not reuse baseline read-only playlists. If the fresh playlist is built in the case's actions (scene-six class, created inside a dialog) → the precondition only guarantees the "already scanned songs" fixture, **do not open a separate segment for it**; if a "mutation starting playlist already containing K songs" is needed → **build a fresh neutrally-named playlist segment for it** (independent of baseline read-only playlists).
|
|
148
|
+
- **Class 3 (empty state / empty library / true conflict state mutually exclusive with fixtures)**: **does not enter pre_test_case**. A fresh install is already an empty library → empty-state cases are naturally satisfied "when no precondition segment has been run, just installed"; write its execution-order exception into the `review_notes.md` **blocking area**'s "## 特殊执行顺序" subsection ("Scenario X-Y must run before any precondition segment is executed, on a fresh-install state"; single companion document, no separate manual-intervention.md). **Never** write a "delete playlists one by one until empty" segment.
|
|
149
|
+
2. **Order segments by dependency**: scan songs → build baseline read-only playlists → fill baseline playlist members → (if any) build mutation-starting fresh playlists. Later segments continue on the cumulative state of earlier segments (force-stop between segments but data persists).
|
|
150
|
+
3. **≤15 steps per segment**; if one segment can't fit, split into the next (e.g., baseline playlists to build 3 + each filled with 3 songs, split into "build playlists" segment and "fill members" segment).
|
|
151
|
+
4. **Segment names concrete, without the word "precondition"** (segment names **may** carry test use, e.g., "创建去重起点歌单" — segment name is human-facing context, not input); but **playlist/song data names that will be really input by the device are all neutral**: playlists use "测试歌单1" "测试歌单2" …, songs use "歌曲A" "歌曲B" …, **never bake use/role/state/entry-method into data names** (forbidden: "去重歌单" "添加目标歌单" "长按目标歌单" "基线只读歌单" "空基线歌单"). See contract §4 "resource naming conventions".
|
|
152
|
+
5. **Segment↔case use mapping** (which segment is referenced by which cases) **is not written into the segment body**, write into the `review_notes.md` non-blocking area.
|
|
153
|
+
6. **After writing, sync test_case.md's "(见前置用例)" references**: the case's precondition should specify which concrete fixture / fresh playlist name it depends on (e.g., "已创建含 3 首歌曲的『测试歌单1』(见前置用例)", neutral name), **verbatim identical** to the concrete name in the pre_test_case segment; if a mutation case builds a fresh playlist in its actions, the precondition only writes "已扫描入库 N 首歌曲(见前置用例)", the fresh playlist is built by actions, not required in preconditions.
|
|
154
|
+
7. **Write every emitted segment from the available information** (contract §4):
|
|
155
|
+
- Start each segment from the app launch page because segments are separate AutoTest tasks; persisted data may carry over, page position does not.
|
|
156
|
+
- Build the chain in execution order from literal SPEC operations, applicable references, and page-local UI elements. Use a matching flow when present; do not add later dialogs/pages/operations when they are not described.
|
|
157
|
+
- Write the segment's inline `期望结果` from the cumulative target state required by the consumer precondition/SPEC.
|
|
158
|
+
|
|
159
|
+
> When no case is tagged `(见前置用例)`, **do not produce** pre_test_case.md.
|
|
160
|
+
|
|
161
|
+
### Step 5 — Write "expected result" + "test point", each TP binary-provable (provable #4)
|
|
162
|
+
|
|
163
|
+
- **Expected result**: non-empty, single line. Stitch each TP's assertion body in verbatim (with step anchors `(步骤N后)`/`(重启应用后)`/`(全流程)`, multiple joined by `;`), **verbatim, no rewriting, no abbreviation, no line break**. Format see contract §3.1.
|
|
164
|
+
- **Test point**: each `- TP-K(步骤N后)?: <concrete binary state>`. Each TP must be a state **the machine can see true/false at some moment**. **Tautological platitudes forbidden** (runs normally / doesn't crash / no exception / displays normally / function works — these say nothing, semantic validation will reject; the program only checks non-empty, but don't write them).
|
|
165
|
+
- **State-migration assertions** (actions changed the state of a countable object) written as **migration volume**, not just final-state snapshot:
|
|
166
|
+
- Add (new/create/add/import/scan-in) → `<object> changed from N <unit> to M <unit>` (M = N+k).
|
|
167
|
+
- Delete (delete/remove/clear/uncollect) → `<object> decreased from N <unit> to M <unit>` (M = N−k).
|
|
168
|
+
- Modify (rename/edit/replace) → `<attribute> changed from "old value" to "new value"`.
|
|
169
|
+
- Idempotent (repeat add / again / undo-then-revert) → `<object> remains N <unit> (no duplicate added / consistent with before operation)`.
|
|
170
|
+
- **Baseline N must be determinate and observable**: prefer values fixed by preconditions / precondition cases; otherwise add a "view and record current count" step in actions; if neither works → fall back to final-state snapshot.
|
|
171
|
+
- **Step anchor**: when actions have ≥2 substantive steps and there are TPs, tag TP with `(步骤M后)` (Chinese parentheses, no colon inside anchor), anchor ≤ number of action steps. Inline each TP's anchor in the expected result.
|
|
172
|
+
- **Unobservable instantaneous / per-frame assertions** (literal highlight / karaoke / smooth scrolling / progress bar advance / toast flashing by / lock-screen instant) → downgrade core ones to coarse-grained observable proxy or keep + tag "needs manual verification"; derived minor ones write `[SKIP: 不可观测]` (SKIP written per step 6's SKIP rules). **But "timed but final-state observable" does not count as unobservable** ("background play 10 seconds then return to foreground" asserts the final state after 10 seconds → observable, keep).
|
|
173
|
+
|
|
174
|
+
### Step 6 — Set priority, honestly write SKIP if can't (fallback #5)
|
|
175
|
+
|
|
176
|
+
1. **priority**: happy path (main success path) tagged `[P0]`; boundary / exception derived by importance `[P0]`/`[P1]`/`[P2]`. Each SPEC/scenario group **must have at least one P0**. Tag order and format see contract §3.1 (`[PX]` first, `[推导]` second, `[SKIP: ...]` last).
|
|
177
|
+
2. **Can't → write SKIP**: when this intent cannot be faithfully written as an executable, decidable-true case, **don't pretend it's done**, write a `[SKIP: <reason>]` record (format see contract §3.2):
|
|
178
|
+
- Choose `reason` from the SKIP enum in contract §3.3. Do not use the removed `前置不可达` category; apply item 3 below instead.
|
|
179
|
+
- **Still write preconditions + non-empty "should-have" expected result**: declare which intent, **what the expected result should be**, append a minimal hand-back phrase. Expected must not write "none / omitted / N.A.".
|
|
180
|
+
- SKIP state is only written in the case header's `[SKIP: <reason>]` tag, **expected result no longer appends SKIP suffix**.
|
|
181
|
+
- Blocking-class SKIP (cross-app / white-box etc.) merged into `review_notes.md` **blocking area** (single companion document, no separate manual-intervention.md); unobservable / frame-level handed back to humans recorded in **non-blocking area**.
|
|
182
|
+
3. **Encountering spec's `> [偏差]` / "precondition pending dependency" (stub implementation / not landed) → go to §2.5, this is a [normal case] not SKIP**:
|
|
183
|
+
- Spec says "current data source always returns empty / not persisted / add is a stub / only appended to end" etc., this is **the product not built yet**, not the test can't see. **First ask: is the assertion itself in principle visible?** (playlist count 1→2, whether the new item is at the top — visible) → **write a normal case per expected behavior** (action + clean "should-have" expected + binary TP), **do not write SKIP, do not tag "precondition unreachable" (that tier is deleted)**. Whatever starting state is needed, **write it in preconditions** (tag `见前置用例` / `特殊测试数据`). The current build is a stub, will fail when run / precondition may be unconstructable — that's **the runner's judgment**: willing to construct then construct, don't want to construct then delete this one, **you don't decide for them**. `不可观测` is reserved only for "per-frame / instantaneous / white-box egress" assertions that are themselves invisible.
|
|
184
|
+
- **Expected result only writes "should-have" behavior, keep clean**: **don't write "current …", don't write source-code filenames / line numbers, don't write "hand back to dev / check DB"**. These status accounts + code references, as **background knowledge items**, go into the review_notes non-blocking area (tell dev/reviewer: this part is currently a stub, will fail when run, line numbers here); test_case.md fields keep not a single word.
|
|
185
|
+
- Example: scene twelve says "newly created is pinned to top and persisted" but `> [偏差]` says "only appended to end, not persisted" → write a normal case: expected "(应有)(步骤N后)新歌单出现在列表顶部、可被选择添加" + TP "新歌单在列表第一位"; record "current appends to end, not persisted" together with code line numbers as background into review_notes non-blocking area. The runner decides whether to delete based on current state.
|
|
186
|
+
4. **White-box / telemetry merge**: intents that purely verify telemetry / statistical events (no UI observable egress, every TP is white-box), each SPEC **merge into ≤1 `[推导] [SKIP: 白盒]`**, expected uses prose to summarize all events, event list recorded in review_notes; **do not** list each telemetry as an independent case. `跨应用` likewise, each class merged into ≤1.
|
|
187
|
+
|
|
188
|
+
### Step 7 — Produce dedup signature, hang into ledger (dedup #6, only produce signature, don't judge equivalence)
|
|
189
|
+
|
|
190
|
+
Compute each `case_signature` exactly as defined in contract §2 #6 and append it to the **resident ledger** for this batch. Render cases stably in execution order with TP numbering from 1; validate.ts recomputes the authoritative signature from `test_case.md`, while the resident ledger only catches obvious within-batch duplicates.
|
|
191
|
+
|
|
192
|
+
Record each exact signature in the ledger. Leave semantic equivalence decisions to the validator:
|
|
193
|
+
- The program (validate.ts) only recognizes **verbatim exact same** signatures = exact duplicate.
|
|
194
|
+
- "Same action, different data, same kind or not" (100 vs 101, playlist A vs playlist B) → **judged by validator (AI)**, not flattened here.
|
|
195
|
+
- Exact duplicate handling (only lands at S6 / validator): **derived cases** colliding can be dropped (with bookkeeping); a scenario's **only (base) case** colliding **is not dropped**, marked red into review_notes — you just record the base/derived identity clearly here.
|
|
196
|
+
|
|
197
|
+
---
|
|
198
|
+
|
|
199
|
+
## Derivation discipline (branch derivation within scenario, do each + bookkeeping)
|
|
200
|
+
|
|
201
|
+
This is the rule for how to fish and how many to fish when S3 traverses "branch sub-intents". **Each one is not to be dropped, not to be changed.**
|
|
202
|
+
|
|
203
|
+
### Derivation types (write one for every `[推导]`)
|
|
204
|
+
|
|
205
|
+
Read the authoritative derivation-type table in contract §3.3 before traversing branch sub-intents. For every `[推导]`, write one listed type plus its concrete trigger and observable change in the `## 场景来源映射` delta. For every pruned branch, record the listed type and pruning reason in review_notes.
|
|
206
|
+
|
|
207
|
+
### D0 — Default 1 case (quota manages upper bound, this manages lower bound)
|
|
208
|
+
|
|
209
|
+
Scenarios with no residual combinations and no semantically implied points **only produce 1 base case**. **Never force-derive to fill numbers**. The derivations below only trigger when the scenario **truly has** residual branches.
|
|
210
|
+
|
|
211
|
+
### D1 — Derive only on literal trigger-word hit
|
|
212
|
+
|
|
213
|
+
A branch's trigger word must **literally** grep-hit in the scenario step text to derive from it. What you want to derive by semantic association, **never masquerade as literal** — go to D6 semantic derivation and bookkeep. Common literal triggers → derivation (on hit, record `{trigger, case#}` in review_notes/`## 场景来源映射`):
|
|
214
|
+
|
|
215
|
+
| Trigger type | Literal trigger word | Derive what | contract §3.3 type |
|
|
216
|
+
|---|---|---|---|
|
|
217
|
+
| Text input boundary | 最大长度 / 特殊字符 / 空值 | Only declared-covered equivalence classes | `边界/错误输入` |
|
|
218
|
+
| Numeric boundary | 数值边界 / 越界 | Each 1 boundary + 1 out-of-bounds | `边界/错误输入` |
|
|
219
|
+
| Exception·permission | 权限拒绝 / 降级 | Permission denial downgrade | `条件输出/决策表` |
|
|
220
|
+
| Exception·empty data | 空数据 / 无数据状态 | Empty-data state | `空态/无数据` |
|
|
221
|
+
| Exception·search | 搜索 / 过滤无匹配结果 | No-match empty state | `空态/无数据` |
|
|
222
|
+
| Flow·cancel | 中途取消 / 返回支持 | Mid-way cancel | `条件输出/决策表` |
|
|
223
|
+
| Flow·first-time | 首次 / 非首次 | Each 1 case | `条件输出/决策表` |
|
|
224
|
+
| Flow·persistence | 退出后保持 / 持久化 | See D2 (only literal "重启") | `持久化/重进页面` |
|
|
225
|
+
| Flow·batch | 批量操作顺序 | Order guarantee verification | `批量/数量变化` |
|
|
226
|
+
| Flow·bidirectional linkage | 同步 / 一致 / 联动 + ≥2 UI 位置 | State values ≤2: Cartesian (≤4); ≥3: random 1 per direction | `状态同步/跨页联动` |
|
|
227
|
+
| Interrupt·background | 切后台 / 回前台 | Background→foreground switch | `中断/生命周期` |
|
|
228
|
+
| Interrupt·orientation | 横屏 / 屏幕旋转 | Orientation switch | `中断/生命周期` |
|
|
229
|
+
|
|
230
|
+
### D2 — Restart/persistence verification = only literal "重启" recognized (forbidden zone)
|
|
231
|
+
|
|
232
|
+
**Only when "重启" explicitly appears in the scenario step text**, add a restart step in actions and produce a persistence TP. **Never self-fabricate restart via "persistent / should retain / still present after exit" semantic association** — this is a **forbidden zone** of semantic derivation.
|
|
233
|
+
- If adding, add a **true cold start** (kill process and reopen), **not** background switch, **not** reinstall.
|
|
234
|
+
- Scenario doesn't write "重启" → this branch **doesn't exist at all**, not even SKIP needs writing (it's not this scenario's intent).
|
|
235
|
+
- (Note: the D1 "persistence" row above "退出后保持/持久化" triggers "exit and re-enter" type verification; **only literal "重启"** upgrades to cold-start restart TP. Don't conflate the two.)
|
|
236
|
+
|
|
237
|
+
### D3 — Multi-entry A/B classification (must explicitly tag, no "forgot to classify")
|
|
238
|
+
|
|
239
|
+
When a scenario has multi-entry expressions like "或者/或/也可以从", **first classify** (explicitly tag A or B in `## 场景来源映射`):
|
|
240
|
+
|
|
241
|
+
- **Class A (different entries → substantively different flows**: data init / validation / dialog differs) → **each entry independently expanded**, each ≥1 success + ≥1 error/validation.
|
|
242
|
+
- **Class B (same component / same data / same oracle, only entry differs**: full-screen page vs half-screen popup into the same login flow; WeChat vs QQ authorization sharing the same TP skeleton) → **sample ≤2**, no Cartesian: ① entry existence 1 case (any entry); ② sync consistency: modify from entry A → verify B/C sync. Fill `b_class` bookkeeping (sample count / Cartesian count avoided).
|
|
243
|
+
- **Class B hard trigger (always B)**: same component different entry points; parallel authorization methods (WeChat/QQ, success/failure/cancel branch structure identical); parametrized mapping differing only in entry label, branch structure identical.
|
|
244
|
+
- Class B takes priority over pairwise: entry factor excluded from pairwise table.
|
|
245
|
+
|
|
246
|
+
### D4 — Enumeration/parametrization pruning (each pruned entry bookkept with reason)
|
|
247
|
+
|
|
248
|
+
| Operation type | Handling |
|
|
249
|
+
|---|---|
|
|
250
|
+
| State change (play/add/remove) | Keep first 3, more bookkept |
|
|
251
|
+
| Pure navigation | Merge into "menu exists + execute one" |
|
|
252
|
+
| Parametrized mapping (same control, param varies) | Randomly keep 1, rest listed in review_notes |
|
|
253
|
+
| Boundary scenarios | Must be independent (not merged) |
|
|
254
|
+
| Decision-table branches (different conditions → different outputs) | 1 per branch, no pruning |
|
|
255
|
+
|
|
256
|
+
Each pruned entry goes into review_notes "未派生的列举操作", with reason.
|
|
257
|
+
|
|
258
|
+
### D5 — ≥3 independent factors → pairwise (t=2)
|
|
259
|
+
|
|
260
|
+
When ≥3 independent factors, each ≥2 values, no strong dependency between factors:
|
|
261
|
+
1. Draw factor table (record in review_notes / ledger).
|
|
262
|
+
2. Cover with t=2, greedy generation; **upper bound about `ceil(maxlevel² × log(factor count))`**.
|
|
263
|
+
3. **Over 15 → downgrade t=1**, and **downgrade explicitly bookkept** (write clearly why downgraded, what's covered after downgrade, what's not), **not silent**.
|
|
264
|
+
4. Each derived tagged `[推导]`, title writes `组合 N (f1=l1, ...)`, record `pairwise` ledger.
|
|
265
|
+
5. Pruned higher-order Cartesian combination count bookkept (`prod(each factor's values) − actual derived count`).
|
|
266
|
+
6. <3 factors or only 1 multi-valued → pairwise not triggered; decision-table branches take priority over pairwise.
|
|
267
|
+
|
|
268
|
+
### D6 — Semantic derivation (advisory + bookkeeping + semantic validation review; never add scenarios by semantics)
|
|
269
|
+
|
|
270
|
+
Semantics of overview / description **only within existing scenarios** assist derivation granularity (e.g., spec mentions "theme / font size / login state / time zone / language" but no literal D1-table hit → you can derive one within that scenario by semantics). **Never add scenarios by semantics** (missing scenario splits are spec defects, outside red line).
|
|
271
|
+
- Derived cases tagged `[推导]`.
|
|
272
|
+
- **Derivation basis (literal trigger word / overview semantics) + reason** recorded into the delta column of `## 场景来源映射` or review_notes ledger (**no inline extra evidence field**).
|
|
273
|
+
- Must be able to write **concrete UI-observable TP**; if can't → **don't derive**.
|
|
274
|
+
- The program only checks "`[推导]` has a corresponding bookkeeping entry"; **whether the derivation is correct is up to validator**.
|
|
275
|
+
|
|
276
|
+
### D7 — Dedup signature only produces signature, doesn't judge equivalence
|
|
277
|
+
|
|
278
|
+
See S3 step 7. **Generator only produces signature, hangs ledger; judging equivalence is up to validator.**
|
|
279
|
+
|
|
280
|
+
---
|
|
281
|
+
|
|
282
|
+
## One intent at a time (cost discipline · self-enforce, not in validate.ts)
|
|
283
|
+
|
|
284
|
+
"One intent at a time" is not a property checkable on finished cases, so **it's self-enforced by you**, not in program checks:
|
|
285
|
+
- **Only load needed materials** (= S2 page rotation): when writing a case, the working set only holds that scenario's span + hit element subset + hit templates, **don't stuff the full SPEC / the whole element table**. Saves window, saves tokens.
|
|
286
|
+
- **Prevent flavor-mixing**: when several scenarios are merged into a batch, **focus only on its own intent when writing each one**, never mix other scenarios' steps/expected into it. "One intent at a time" = focus on each one when writing each one, **not** "only one scenario can be fed at a time".
|
|
287
|
+
- The validator only logs a non-blocking suspicion when it finds obvious "mixing other scenarios' materials in".
|
|
288
|
+
|
|
289
|
+
---
|
|
290
|
+
|
|
291
|
+
## Honest fallback (every intent must have a destination)
|
|
292
|
+
|
|
293
|
+
Every intent **must produce one case or one SKIP record**, **must not leave nothing** (vanishing into thin air = silent failure, S6 will catch by set difference and roll back).
|
|
294
|
+
- Can test → write case.
|
|
295
|
+
- Can't → write `[SKIP: <reason>]` (reason ∈ enumeration), **still write non-empty "should-have" expected**, declare which intent, what obstacle, what the expected result should be, handed back to whom.
|
|
296
|
+
- Neither "should SKIP but written as fake case" (pretending can test), nor "could test but lazily marked SKIP" (skipping test) — the validator backstops both directions.
|
|
297
|
+
|
|
298
|
+
---
|
|
299
|
+
|
|
300
|
+
## repair mode
|
|
301
|
+
|
|
302
|
+
On receiving `mode: repair` + `report` (`cases-report.json` or validator's FAIL verdict):
|
|
303
|
+
|
|
304
|
+
1. **Same-page rewrite, no page rotation**: don't rerun S2, don't redo BFS, don't re-derive the full set. Still read the current `{output-path}/test_case.md` as baseline.
|
|
305
|
+
2. **Only fix named fields**: take `failed_items` from the report (S4 uses `rule/scenario_id`; S5 uses `scenario/field/disposition`), follow its reason/fix hint, and **only touch the named cases/fields**. Leave the rest as-is. The sole addition exception is an S5 item with `semantic_class=complete` and `field=派生覆盖`: its named base Scenario is the routing anchor, and you may append exactly the one missing derived case cited by that item. Typical fixes:
|
|
306
|
+
- Missing/empty fields (action/expected/TP/precondition) → fill with non-empty content.
|
|
307
|
+
- SKIP reason not in enumeration → replace with a legal value from the enumeration.
|
|
308
|
+
- Precondition tag not in enumeration → replace with a legal tag.
|
|
309
|
+
- Scenario mapping inconsistent (Scenario N doesn't match mapping table / referenced SPEC doesn't exist) → fix mapping or fix number.
|
|
310
|
+
- S4 names a broken fold pointer (`fold_target_scenario_missing` / `fold_target_tp_missing`) → **two fix methods, pick one**: **update** the `去向=fold:N-M#TP-k` pointer to point at an existing TP, **or restore** the missing TP-k in the target Scenario (land the merged/asserting TP the fold claims). Never silently drop the folded branch.
|
|
311
|
+
- S4 names `prose_fold_claim` → **delete** the `折叠进/折叠入/folded into` prose from review_notes/test_case; if the fold is real, re-record it as a `去向=fold:` ledger row + the asserting TP instead of prose.
|
|
312
|
+
- Validator names "weak source / weak oracle / tautological TP / vague action / expected contradicts SPEC" → rewrite the named case's action/TP/expected to be faithful, concrete, binary.
|
|
313
|
+
- Validator names one missing derived branch with `field=派生覆盖` → append exactly that cited branch under the anchored base Scenario's SPEC scene, assign its next unused `N-M`, and add its derivation ledger entry; do not expand adjacent branches.
|
|
314
|
+
- Validator judges "structurally can't do" (semantic gap indeed / anchor inherently unstable / comparison baseline inherently unobservable / overreach self-fabricated restart) → convert that case to `[SKIP: <reason>]` (still write non-empty should-have expected), or delete the overreaching self-fabricated restart branch.
|
|
315
|
+
3. **Use the validator report mechanically**: for `disposition=repair`, apply `fix_hint` only to the named case/field; for `disposition=convert_to_skip`, apply the named legal SKIP reason and preserve a non-empty should-have expected result + handoff. Never reinterpret a non-blocking review note as a repair request.
|
|
316
|
+
4. **Synchronize only direct dependents**: if the named rewrite changes a Scenario id, mapping, `(见前置用例)` resource name/state, or SKIP status, update only the directly corresponding ledger row, `pre_test_case.md` segment, and review-note entry. Do not rewrite unrelated cases or globally reorganize `pre_test_case.md`; S6 owns global deduplication/renumbering.
|
|
317
|
+
5. **Don't re-derive the full set**: except for the single `派生覆盖` branch explicitly cited above, don't take the opportunity to add / re-derive cases not named. Hand back when done; the orchestrator re-runs S4 before S5 after a semantic repair.
|