[intern-31] Integration test: convert → chunk → query - #422
Conversation
Cover intern-31 / #369 with a real DOCX fixture: convert_path, heading chunks (count/title/order), then keyword search_corpus. Co-authored-by: Cursor <cursoragent@cursor.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
Bugbot Autofix prepared a fix for the issue found in the latest run.
- ✅ Fixed: Unmanaged test fixture
- Added crates/core/tests/fixtures/manifest.json for heading-hierarchy.docx and wired that root into make check-fixtures so checksum, unmanaged-file, and secret-canary checks cover it.
Or push these changes by commenting:
@cursor push fe6df63fc6
Preview (fe6df63fc6)
diff --git a/Makefile b/Makefile
--- a/Makefile
+++ b/Makefile
@@ -49,6 +49,7 @@
python3 scripts/check-fixtures.py
python3 scripts/check-fixtures.py --root app/src-tauri/fixtures/knowledge/v1
python3 scripts/check-fixtures.py --root crates/knowledge/fixtures
+ python3 scripts/check-fixtures.py --root crates/core/tests/fixtures
python3 scripts/check-fixtures.py --self-test
check-markhand-gates:
diff --git a/crates/core/tests/fixtures/manifest.json b/crates/core/tests/fixtures/manifest.json
new file mode 100644
--- /dev/null
+++ b/crates/core/tests/fixtures/manifest.json
@@ -1,0 +1,15 @@
+{
+ "version": 1,
+ "fixtures": [
+ {
+ "id": "core.docx.heading-hierarchy.v1",
+ "path": "heading-hierarchy.docx",
+ "sha256": "806a293e688a70880f3a62a727fc84085d76cf8862c861dcf259a1819c3aaf25",
+ "kind": "docx",
+ "owner": "markhand-core",
+ "source": "synthetic",
+ "license": "CC0-1.0",
+ "sensitive": false
+ }
+ ]
+}You can send follow-ups to the cloud agent here.
Reviewed by Cursor Bugbot for commit f7771c1. Configure here.
| path.is_file(), | ||
| "missing fixture at {} — add heading-hierarchy.docx under crates/core/tests/fixtures/", | ||
| path.display() | ||
| ); |
There was a problem hiding this comment.
Unmanaged test fixture
Medium Severity
The new heading-hierarchy.docx under crates/core/tests/fixtures/ has no local manifest.json (id, sha256, license, sensitive: false) and is not wired into make check-fixtures. That skips the repo fixture contract and secret/canary checks used by other component fixture roots such as crates/knowledge/fixtures.
Reviewed by Cursor Bugbot for commit f7771c1. Configure here.



Closes #369
cc @anhnth24 — em xin gửi PR intern-31 để anh review ạ.
Summary
crates/core/tests/integration_convert_chunk.rs: file DOCX thật →Converter::convert_path→chunk_markdown→search_corpus.crates/core/tests/fixtures/heading-hierarchy.docx(Heading 1Phần I+ intro + 3× Heading 2Mục 1/2/3, mãREF-M1/M2/M3). Không dùng tài liệu khách hàng.CARGO_MANIFEST_DIR+tests/fixtures/). Không đổi logic production.Thay đổi file
crates/core/tests/fixtures/heading-hierarchy.docxDOCX tự soạn, style Word Heading 1/2 (không chỉ Bold). Convert ra:
Golden DOCX sẵn có (
gold-006.docx, …) chỉ 1 H1 + 1 H2 → sau chunk thường 1 mảnh, không đủ AC “heading 1 → 2–3 heading 2”.Tên file mô tả nội dung (
heading-hierarchy), không gắnintern31. Trace issue để ở title PR /Closes #369.crates/core/tests/integration_convert_chunk.rsMột test:
integration_convert_chunk_then_query_happy_path.Luồng:
Converter::new().convert_path— convert thật,format == Docx, markdown có# Phần I.chunk_markdown(md, 2000)— chia theo heading, giữ path"Phần I > Mục 2".build_corpus+search_corpus("REF-M2", 5)— keyword search có sẵn (không viết TF-IDF riêng).Test nào pass? Assertion nào validate?
chunks.len() == 4,corpus.len()khớpchunks[i].heading=Phần I,Phần I > Mục 1/2/3chunks[i].index == isearch_corpus("REF-M2")không rỗng,hits[0]chứaMục 2Vì sao đây là integration test (không nhét vào
chunk.rs)?chunk.rs(intern-05) đã khóa heading path trên chuỗi Markdown hardcode.convert_pathsẽ không chứng minh file thật convert đúng.Test plan
cargo test -p fileconv-core integration_convert_chunk -- --nocapturecargo fmt --all -- --checkcargo metadata --locked --format-version 1 --no-depspython3 scripts/check-dependency-policy.py