From 0ea19ed655e804e7a848464c0e6b317b667d7ac4 Mon Sep 17 00:00:00 2001 From: tukuaiai Date: Sat, 2 May 2026 04:01:07 +0800 Subject: [PATCH] fix: prompts-library - preserve excel jsonl row numbers --- CHANGELOG.md | 1 + tools/prompts-library/main.py | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f7a22e5..abcb127 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,3 +9,4 @@ - 更新 README、AGENTS、llms、metadata、CI 与目录级 AGENTS,统一新知识库路径口径。 - 增加 `scripts/check-local-links.py`、`make check-links` 与 `make test`,把本地链接检查纳入质量门禁和 CI。 - 清退 `tools/external/my-nvim/nvim-config/nvim` 二进制运行时,改为文档说明从官方渠道安装 Neovim。 +- 修复 `tools/prompts-library/main.py` 中 Excel(JSONL) -> JSONL 转换的行号偏移,保持导出记录与 Excel 原始行号一致。 diff --git a/tools/prompts-library/main.py b/tools/prompts-library/main.py index 38a6ef2..790085d 100644 --- a/tools/prompts-library/main.py +++ b/tools/prompts-library/main.py @@ -336,7 +336,7 @@ def run_jsonl_excel_to_jsonl(excel_path: Path, project_root: Path) -> int: sheet_lines.append(json.dumps({ "category_id": cat_id, "category": cat_name, - "row": row_idx + 2, + "row": row_idx + 1, "col": col_idx + 1, "title": obj["title"][:80], "content": obj["content"] @@ -351,7 +351,7 @@ def run_jsonl_excel_to_jsonl(excel_path: Path, project_root: Path) -> int: build_text_record( cat_id=cat_id, cat_name=cat_name, - row=row_idx + 2, + row=row_idx + 1, col=col_idx + 1, text=val_str, )