Classification-boundary adjustments in prompts.py (the single source the
parser validates against, so parser.py needs no change):
- Rename fine type 检验记录过程性 -> 检验记录 in the 资料类 enumeration.
- 法兰隔膜 no longer counts as an attachment: removed from the 配件类
enumeration (25 -> 24 fine types) and the prose example list, added an
explicit rule bullet and 注意 note that it is ignored even when the
param text mentions it, and fixed the stale comment that referenced it.
- Updated the few-shot example: input still mentions 法兰隔膜 but the
expected output now lists only 紧固件, actively teaching the model to
ignore 法兰隔膜.
- README category lists/counts synced (检验记录 rename; 配件类 25 -> 24).
Verified via parser: 检验记录 and 紧固件 validate; 检验记录过程性 and
法兰隔膜 are now rejected as non-enum fine types.
Co-Authored-By: Claude <noreply@anthropic.com>
- Add --append flag: diff source-table 总排号 against existing
Common.Attachment SN and classify/write only the missing ones. --limit
caps the per-run append count, --order sets the direction. Backed by
new fetch_existing_attachment_sns() in db.py.
- Fix batch elapsed-time accounting: summarize_results() summed each
task's per-item elapsed_ms, which overcounts under ThreadPoolExecutor
concurrency (cumulative work time, not real wall-clock — 100 tasks on
8 workers reported ~5x the actual runtime). Callers now time
classify_batch() via perf_counter and pass wall_clock_ms; both the
write_attachments [汇总] line and main.py --summary report wall-clock
separately from the cumulative sum.
- Format durations >=1s in seconds (88851.4 ms -> 88.85 s) in the
human-readable [汇总] line; structured JSON --summary fields stay in ms.
- Chunk all IN (...) lists to 2000 items to respect SQL Server's 2100
bind-parameter hard limit (previously --append --limit 5000 failed at
the fetch step with "COUNT 字段不正确"). Applied to fetch_params_by_ids
(sn / id paths) and to the DELETE inside upsert_attachments.
Co-Authored-By: Claude <noreply@anthropic.com>