feat(export): 采纳定额携带含量算式与换算调整,屏蔽金额汇总行改价同步

This commit is contained in:
lianjianwei2024
2026-10-18 20:25:27 +08:00
parent 9ddd9bb240
commit b0dc236245
30 changed files with 2727 additions and 274 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,190 @@
# 核心设计意图覆盖核验报告
> 生成方式:只读静态扫描,未 import / 未修改 CostReview 任何文件。
总意图数:**8** | 已覆盖:**7** | 未覆盖:**1**
## [✅] INT-01 价格导入:一个块=一个批次
- 描述:HTML 一个顶层块=一批次;期次优先级 块名→文件名→弹框;批次名 多块用块名/单块用弹框名。
- 源码存在:True | 测试覆盖:True | 强度:**强(邻近有断言)** | 邻近断言数:104
- 源码命中文件:core\export_cos.py, core\export_xlsx.py, core\import_job.py, core\match.py, core\price_html.py, core\price_xlsx.py, core\session_job.py, server\api_server.py, server\mcp_server.py, tests\test_api_p1.py, tests\test_api_upgrade.py, tests\test_export_structure.py, tests\test_kw_tier.py, tests\test_lme_uw_card.py, tests\test_match_tiers.py, tests\test_norm_op.py, tests\test_price_redesign.py, tests\test_unit_core.py, tools\backfill_lme_lib.py, tools\check_parity.py, tools\gen_price_mock.py, tools\gen_project_mock.py, tools\purge_batches.py, tools\rebuild_batch_db.py
- 测试引用(intent=与本意图邻近的断言数 / total=函数内总断言数):
- `test_api_p1.py::test_inq_lifecycle` (intent=3 / total=12)
- `test_api_p1.py::test_adopt_flow` (intent=1 / total=8)
- `test_api_p1.py::test_clear_mock_keeps_real` (intent=2 / total=3)
- `test_api_p1.py::test_price_import_rejects_empty_class` (intent=1 / total=1)
- `test_api_p1.py::test_price_import_single_and_dup` (intent=8 / total=8)
- `test_api_upgrade.py::test_upgrade_via_admin_api` (intent=2 / total=4)
- `test_api_upgrade.py::test_upgrade_via_audit_open` (intent=1 / total=3)
- `test_api_upgrade.py::test_upgrade_price_batch_rejected` (intent=2 / total=2)
- `test_export_structure.py::test_resource_pseudo_norm_skipped_on_import` (intent=2 / total=3)
- `test_export_structure.py::test_coef_unit_prefix_no_double_count` (intent=1 / total=4)
- `test_kw_tier.py::test_strict_first_loose_last` (intent=0 / total=1)
- `test_kw_tier.py::test_rank_combined_with_filters` (intent=2 / total=2)
- `test_match_tiers.py::test_disabled_batch_excluded` (intent=1 / total=1)
- `test_match_tiers.py::test_period_distance_sort_and_window` (intent=3 / total=3)
- `test_norm_op.py::test_norm_ntdel_export_omits` (intent=4 / total=8)
- `test_price_redesign.py::test_dirs_tree_and_counts` (intent=2 / total=9)
- `test_price_redesign.py::test_prices_filter_and_export` (intent=8 / total=11)
- `test_unit_core.py::test_price_html_parse_and_records` (intent=4 / total=8)
- `test_unit_core.py::test_price_xlsx_parse_and_template` (intent=5 / total=10)
- `test_api_group.py::test_group_conservation_and_name_layer` (intent=4 / total=9)
- `test_export_structure.py::test_new_bill_full_structure_cos` (intent=0 / total=12)
- `test_unit_core.py::test_clean_attr_strips_and_guard` (intent=3 / total=3)
- `test_unit_core.py::test_guess_period` (intent=4 / total=4)
- `test_unit_core.py::test_price_html_rejects_non_data` (intent=1 / total=2)
- `test_api_p0.py::test_gate_off_and_status` (intent=0 / total=2)
- `test_api_p0.py::test_import_project_ok` (intent=3 / total=10)
- `test_api_p0.py::test_import_encrypted_rejected` (intent=1 / total=1)
- `test_api_p0.py::test_import_unknown_rejected` (intent=1 / total=1)
- `test_api_p0.py::test_import_xml_rejected` (intent=1 / total=1)
- `test_api_p0.py::test_import_outside_path_rejected` (intent=1 / total=1)
- `test_api_p0.py::test_import_dup_confirm_then_force` (intent=3 / total=3)
- `test_api_p0.py::test_search_bill_self_excluded` (intent=0 / total=4)
- `test_api_p0.py::test_search_lme` (intent=0 / total=2)
- `test_api_p0.py::test_hist_search_kw` (intent=0 / total=4)
- `test_api_p0.py::test_delete_batch_cascade` (intent=1 / total=6)
- `test_api_p0.py::test_batch_row_edit_whitelist` (intent=0 / total=3)
- `test_api_p1.py::test_attach_lifecycle` (intent=1 / total=10)
- `test_api_p1.py::test_enabled_toggle` (intent=1 / total=3)
- `test_api_p1.py::test_price_xlsx_import` (intent=2 / total=12)
- `test_api_p1.py::test_dict_roundtrip` (intent=0 / total=7)
- `test_export_ext.py::test_ext_follows_source` (intent=1 / total=1)
- `test_export_structure.py::test_new_bill_top_anchor_position` (intent=1 / total=4)
- `test_export_structure.py::test_adoption_carries_express_adjustment` (intent=1 / total=6)
- `test_license_import.py::test_repo_pinned_keys_prod_key_self_consistent` (intent=0 / total=4)
- `test_license_import.py::test_import_validate_matrix` (intent=2 / total=2)
- `test_license_import.py::test_import_error_never_echoes_content` (intent=3 / total=3)
- `test_license_import.py::test_import_loopback_http_dev_only` (intent=2 / total=2)
- `test_license_import.py::test_import_happy_path` (intent=3 / total=3)
- `test_license_import.py::test_import_conflict_needs_explicit_confirm` (intent=5 / total=5)
- `test_license_import.py::test_import_same_instance_no_confirm_needed` (intent=1 / total=1)
- `test_license_import.py::test_import_high_water_preserved` (intent=2 / total=2)
- `test_license_verify.py::test_revoked_key` (intent=0 / total=0)
- `test_license_verify.py::test_non_p256_key_rejected_at_ring_build` (intent=0 / total=0)
- `test_lme_price.py::test_export_recode_renames_mother_and_rebuilds_children` (intent=0 / total=3)
- `test_lme_price.py::test_export_recode_childless_renames_only` (intent=0 / total=2)
- `test_norm_op.py::test_adopt_gcl_default_and_price_overwrite` (intent=0 / total=7)
- `test_norm_op.py::test_qty_export_follows_source_pattern` (intent=2 / total=6)
- `test_perf_baseline.py::test_large_project_import_and_open` (intent=1 / total=3)
- `test_perf_baseline.py::test_read_not_starved_under_write` (intent=0 / total=1)
- `test_price_redesign.py::test_dir_add_rename_move_seq` (intent=0 / total=11)
- `test_price_redesign.py::test_dir_del_rows_fall_uncat` (intent=0 / total=4)
- `test_price_redesign.py::test_row_crud_and_hash` (intent=1 / total=11)
- `test_unit_core.py::test_sniff` (intent=0 / total=1)
## [✅] INT-02 工料机/价格分表存储 + 判批次用 kind
- 描述:x_rows_lme 只存工料机数,x_rows_price 只存价格数;判断批次有没有工料机一律用 kind='project',永远别用行数。
- 源码存在:True | 测试覆盖:True | 强度:**强(邻近有断言)** | 邻近断言数:50
- 源码命中文件:core\export_xlsx.py, core\import_job.py, core\match.py, server\api_server.py, tests\test_api_p0.py, tests\test_api_p1.py, tests\test_price_redesign.py, tools\backfill_lme_lib.py, tools\gen_price_mock.py, tools\gen_project_mock.py, tools\test_parse_std.py
- 测试引用(intent=与本意图邻近的断言数 / total=函数内总断言数):
- `test_api_p0.py::test_import_project_ok` (intent=4 / total=10)
- `test_api_p1.py::test_price_xlsx_import` (intent=4 / total=12)
- `test_api_p1.py::test_price_import_single_and_dup` (intent=8 / total=8)
- `test_price_redesign.py::test_row_crud_and_hash` (intent=5 / total=11)
- `test_api_p0.py::test_import_dup_confirm_then_force` (intent=2 / total=3)
- `test_api_p1.py::test_inq_lifecycle` (intent=1 / total=12)
- `test_api_p1.py::test_clear_mock_keeps_real` (intent=0 / total=3)
- `test_api_p1.py::test_price_import_rejects_empty_class` (intent=1 / total=1)
- `test_api_upgrade.py::test_upgrade_via_audit_open` (intent=3 / total=3)
- `test_api_upgrade.py::test_upgrade_price_batch_rejected` (intent=1 / total=2)
- `test_export_structure.py::test_new_bill_top_anchor_position` (intent=1 / total=4)
- `test_export_structure.py::test_adoption_carries_express_adjustment` (intent=2 / total=6)
- `test_export_structure.py::test_resource_pseudo_norm_skipped_on_import` (intent=1 / total=3)
- `test_export_structure.py::test_coef_unit_prefix_no_double_count` (intent=0 / total=4)
- `test_kw_tier.py::test_rank_combined_with_filters` (intent=1 / total=2)
- `test_license_import.py::test_repo_pinned_keys_prod_key_self_consistent` (intent=1 / total=4)
- `test_license_verify.py::test_package_vectors_canonical_matches` (intent=2 / total=2)
- `test_lme_price.py::test_merge_child_group_repoints_unit_mothers_and_replaces_children` (intent=0 / total=9)
- `test_lme_price.py::test_http_lme_price_end_to_end` (intent=1 / total=10)
- `test_norm_op.py::test_norm_unadopt_hard_delete` (intent=0 / total=6)
- `test_norm_res_name.py::test_collision_row_takes_summary_whole` (intent=1 / total=2)
- `test_perf_baseline.py::test_large_project_import_and_open` (intent=1 / total=3)
- `test_perf_baseline.py::test_read_not_starved_under_write` (intent=0 / total=1)
- `test_price_redesign.py::test_prices_filter_and_export` (intent=1 / total=11)
- `test_unit_core.py::test_sim_weighted_token_veto` (intent=0 / total=2)
- `test_unit_core.py::test_lme_list_where_kind_cast` (intent=0 / total=1)
- `test_unit_core.py::test_parse_std_structure` (intent=9 / total=14)
## [✅] INT-03 会话↔后台批次同源绑定
- 描述:靠 batches.x_src_hash == sessions.src_name(都是 sha256_原名)只认同源文件;工作台只读,绑定/改绑只在后台。
- 源码存在:True | 测试覆盖:True | 强度:**强(邻近有断言)** | 邻近断言数:4
- 源码命中文件:core\export_cos.py, core\import_job.py, core\match.py, core\session_job.py, server\api_server.py, tests\test_api_upgrade.py, tests\test_export_ext.py, tests\test_kw_tier.py, tests\test_lme_proj_source.py, tests\test_lme_uw_card.py, tests\test_match_tiers.py, tests\test_norm_res_name.py, tests\test_source_guards.py, tests\test_stopwords.py, tools\backfill_lme_lib.py, tools\gen_price_mock.py, tools\gen_project_mock.py, tools\purge_batches.py, tools\test_parse_std.py
- 测试引用(intent=与本意图邻近的断言数 / total=函数内总断言数):
- `test_api_upgrade.py::test_upgrade_via_audit_open` (intent=0 / total=3)
- `test_export_ext.py::test_ext_follows_source` (intent=1 / total=1)
- `test_source_guards.py::test_reopen_with_new_file_syncs_src_and_remarks` (intent=3 / total=9)
## [✅] INT-04 列表排序口径
- 描述:排序 x_period_end_m DESC, x_imported_at DESC, id DESC(期次最新最前)。
- 源码存在:True | 测试覆盖:True | 强度:**强(邻近有断言)** | 邻近断言数:15
- 源码命中文件:core\export_xlsx.py, core\import_job.py, core\match.py, core\search_demo.py, server\api_server.py, tests\test_api_p1.py, tests\test_kw_tier.py, tests\test_match_tiers.py, tests\test_stopwords.py, tools\gen_price_mock.py, tools\gen_project_mock.py
- 测试引用(intent=与本意图邻近的断言数 / total=函数内总断言数):
- `test_api_p1.py::test_price_xlsx_import` (intent=3 / total=12)
- `test_api_p1.py::test_price_import_single_and_dup` (intent=4 / total=8)
- `test_api_group.py::test_group_conservation_and_name_layer` (intent=4 / total=9)
- `test_group_order.py::test_kw_group_mixed_by_tsum` (intent=1 / total=4)
- `test_kw_tier.py::test_loose_flag_matches_rank` (intent=0 / total=1)
- `test_norm_res_name.py::test_merge_groups_keep_composite_rows` (intent=3 / total=5)
## [✅] INT-05 序号递减口径
- 描述:序号 seq = total - ((page-1)*size + i)(首行=总数递减)。
- 源码存在:True | 测试覆盖:True | 强度:**强(邻近有断言)** | 邻近断言数:16
- 源码命中文件:core\export_cos.py, core\export_xlsx.py, core\import_job.py, core\match.py, core\price_xlsx.py, core\session_job.py, server\api_server.py, server\license_client\gate.py, shell.py, tests\test_api_group.py, tests\test_group_order.py, tests\test_grp_units.py, tests\test_kw_tier.py, tests\test_lme_price.py, tests\test_lme_proj_source.py, tests\test_match_tiers.py, tests\test_norm_res_name.py, tests\test_perf_baseline.py, tests\test_price_redesign.py, tests\test_stopwords.py, tools\check_parity.py, tools\gen_price_mock.py, tools\health_check.py, tools\purge_batches.py, tools\rebuild_batch_db.py
- 测试引用(intent=与本意图邻近的断言数 / total=函数内总断言数):
- `test_api_group.py::test_group_keyword_layer` (intent=0 / total=3)
- `test_group_order.py::test_kw_group_mixed_by_tsum` (intent=0 / total=4)
- `test_lme_price.py::test_merge_child_group_repoints_unit_mothers_and_replaces_children` (intent=3 / total=9)
- `test_norm_res_name.py::test_merge_groups_keep_composite_rows` (intent=1 / total=5)
- `test_price_redesign.py::test_dirs_tree_and_counts` (intent=1 / total=9)
- `test_price_redesign.py::test_dir_add_rename_move_seq` (intent=2 / total=11)
- `test_kw_tier.py::test_pagination_rank_stable` (intent=2 / total=2)
- `test_perf_baseline.py::test_large_project_import_and_open` (intent=1 / total=3)
- `test_perf_baseline.py::test_read_not_starved_under_write` (intent=0 / total=1)
- `test_price_redesign.py::test_prices_filter_and_export` (intent=4 / total=11)
- `test_stopwords.py::test_stop_before_limit_pagination` (intent=2 / total=2)
## [✅] INT-06 询价附件项目专属
- 描述:询价附件=项目专属,lmes 与 prices 零交叉,附件挂 lmes 天然只落项目;代码显式断言 kind='project'。
- 源码存在:True | 测试覆盖:True | 强度:**强(邻近有断言)** | 邻近断言数:34
- 源码命中文件:core\export_xlsx.py, core\import_job.py, core\match.py, core\search_demo.py, core\session_job.py, server\api_server.py, tests\api_harness.py, tests\test_api_p0.py, tests\test_api_p1.py, tests\test_lme_price.py, tests\test_lme_proj_source.py, tests\test_lme_uw_card.py, tests\test_norm_res_name.py, tests\test_perf_baseline.py, tests\test_unit_core.py, tools\backfill_lme_lib.py, tools\check_parity.py, tools\gen_price_mock.py, tools\gen_project_mock.py, tools\purge_batches.py, tools\rebuild_batch_db.py, tools\test_parse_std.py
- 测试引用(intent=与本意图邻近的断言数 / total=函数内总断言数):
- `test_api_p1.py::test_attach_lifecycle` (intent=0 / total=10)
- `test_api_p1.py::test_inq_lifecycle` (intent=11 / total=12)
- `test_api_p1.py::test_adopt_flow` (intent=3 / total=8)
- `test_price_redesign.py::test_prices_filter_and_export` (intent=3 / total=11)
- `test_api_p0.py::test_audit_open_reuse_and_remark` (intent=2 / total=9)
- `test_api_p0.py::test_delete_batch_cascade` (intent=5 / total=6)
- `test_lme_price.py::test_raw_uw_rows_are_nine_wide_with_taxrate_at_7` (intent=0 / total=4)
- `test_lme_price.py::test_raw_proj_fallback_nine_wide_taxrate_at_7` (intent=0 / total=4)
- `test_lme_price.py::test_raw_proj_fallback_without_taxrate_column` (intent=0 / total=1)
- `test_lme_price.py::test_raw_uw_agg_fallback_nine_wide_taxrate_at_7` (intent=0 / total=4)
- `test_lme_proj_source.py::test_migrate_rekeys_events_and_gate` (intent=0 / total=4)
- `test_norm_res_name.py::test_name_prefers_unit_summary` (intent=2 / total=2)
- `test_norm_res_name.py::test_legacy_chain_intact` (intent=1 / total=1)
- `test_norm_res_name.py::test_prices_filled_from_summary_when_missing` (intent=0 / total=1)
- `test_norm_res_name.py::test_collision_row_takes_summary_whole` (intent=0 / total=2)
- `test_perf_baseline.py::test_large_project_import_and_open` (intent=0 / total=3)
- `test_unit_core.py::test_parse_std_structure` (intent=7 / total=14)
## [❌] INT-07 数据源字典口径
- 描述:dict_region + dict_org(cat: publisher|builder);录入类下拉只取字典,过滤类下拉取 字典∪库里实际值。
- 源码存在:True | 测试覆盖:False | 强度:**未覆盖** | 邻近断言数:0
- 源码命中文件:core\match.py, server\api_server.py, tests\test_api_p1.py, tests\test_api_upgrade.py, tests\test_kw_tier.py, tests\test_price_redesign.py, tests\test_stopwords.py, tools\gen_price_mock.py
## [✅] INT-08 信息价期次优先级
- 描述:价格导入期次优先级 块名→文件名→弹框;一个块=一个批次。
- 源码存在:True | 测试覆盖:True | 强度:**强(邻近有断言)** | 邻近断言数:15
- 源码命中文件:core\export_xlsx.py, core\import_job.py, core\match.py, core\price_html.py, core\price_xlsx.py, core\search_demo.py, core\session_job.py, server\api_server.py, tests\api_harness.py, tests\test_api_p0.py, tests\test_api_p1.py, tests\test_kw_tier.py, tests\test_lme_price.py, tests\test_match_tiers.py, tests\test_norm_res_name.py, tests\test_unit_core.py, tools\check_parity.py
- 测试引用(intent=与本意图邻近的断言数 / total=函数内总断言数):
- `test_api_p0.py::test_batch_row_edit_whitelist` (intent=3 / total=3)
- `test_api_p1.py::test_price_xlsx_import` (intent=3 / total=12)
- `test_api_p1.py::test_price_import_single_and_dup` (intent=3 / total=8)
- `test_kw_tier.py::test_strict_first_loose_last` (intent=0 / total=1)
- `test_kw_tier.py::test_pagination_rank_stable` (intent=0 / total=2)
- `test_match_tiers.py::test_period_distance_sort_and_window` (intent=3 / total=3)
- `test_unit_core.py::test_sniff` (intent=1 / total=1)
- `test_lme_price.py::test_sub_composition_rows_are_editable` (intent=1 / total=2)
- `test_lme_price.py::test_merge_still_registers_codes_after_refactor` (intent=1 / total=3)
- `test_lme_price.py::test_merge_group_includes_child_rows_with_flag` (intent=0 / total=3)
- `test_norm_res_name.py::test_merge_groups_keep_composite_rows` (intent=0 / total=5)