feat(rag): harden post-LightRAG runtime
Retire legacy OCR/media/evidence fallbacks, add local-folder event bus and Page Aggregate guards, and archive completed design checklists. Validation: cargo test -p mnote-web -- --test-threads=1; cargo test --workspace -- --test-threads=1; git diff --check; codegraph sync .; codegraph_status.
This commit is contained in:
@@ -125,6 +125,7 @@ async function openKnowledgePanel(page) {
|
||||
state: "visible",
|
||||
timeout: UI_TIMEOUT_MS,
|
||||
});
|
||||
await page.locator('[data-knowledge-rag-action="filter-sources"][data-knowledge-rag-filter="all"]').click({ timeout: UI_TIMEOUT_MS });
|
||||
}
|
||||
|
||||
async function waitForSourceRow(page, sourcePath) {
|
||||
@@ -155,6 +156,8 @@ async function main() {
|
||||
|
||||
const scoped = await query(context, marker, [sourceA]);
|
||||
const scopedReferences = Array.isArray(scoped.references) ? scoped.references : [];
|
||||
assert.equal(scoped.sourceScopeMode, "post_filter_mapped_references", `sourcePaths scope mode 应明确为 post-filter: ${JSON.stringify(scoped, null, 2).slice(0, 3000)}`);
|
||||
assert.equal(scoped.rawScopeFiltered, false, `rawScopeFiltered 应明确提示 provider raw 未被 sourcePaths 预过滤: ${JSON.stringify(scoped, null, 2).slice(0, 3000)}`);
|
||||
assert(scopedReferences.length > 0, `sourcePaths scope 应至少返回 alpha: ${JSON.stringify(scoped, null, 2).slice(0, 3000)}`);
|
||||
assert(
|
||||
scopedReferences.every((reference) => reference.sourceRootRelativePath === sourceA),
|
||||
@@ -170,7 +173,8 @@ async function main() {
|
||||
await page.waitForFunction(
|
||||
(expectedPath) => {
|
||||
const row = document.querySelector(`[data-knowledge-rag-source-row="true"][data-knowledge-rag-source-path="${expectedPath}"]`);
|
||||
return row && (row.textContent || "").includes("已删除");
|
||||
const text = row ? row.textContent || "" : "";
|
||||
return text.includes("已删除") || text.includes("删除已提交") || text.includes("LightRAG 已移除");
|
||||
},
|
||||
sourceA,
|
||||
{ timeout: UI_TIMEOUT_MS },
|
||||
@@ -191,6 +195,8 @@ async function main() {
|
||||
sourceA,
|
||||
sourceB,
|
||||
sourceScope: scoped.sourceScope,
|
||||
sourceScopeMode: scoped.sourceScopeMode,
|
||||
rawScopeFiltered: scoped.rawScopeFiltered,
|
||||
scopedReferenceCount: scopedReferences.length,
|
||||
alphaDocId: entryFor(indexedStatus, sourceA)?.lightRagDocId || null,
|
||||
betaDocId: entryFor(indexedStatus, sourceB)?.lightRagDocId || null,
|
||||
|
||||
Reference in New Issue
Block a user