|| Records | Record of level-skippers | Record of level-skippers query | Record of level-skippers sleuth


)

const bulletedFiles = [];

for (let line of lines) {
// Match lines with —> pattern and extract the LEFT side
const match = line.match(/^-\s*[[([^]|]+)(?:|[^]]+)?]]\s*—>/);
if (match) {
const parent = match[1].trim();
bulletedFiles.push(parent);
}
}

// Run the reference query logic
const symbols = [”✺”, ”∂”, ”𝛿”, ”𖣐”, ”֎”, ”📖”];
const pages = dv.pages(‘“Concepts/Concepts”’);
const referenceFiles = [];

for (let p of pages) {
const fileContent = await dv.io.load(p.file.path);
const fileLines = fileContent.split(‘\n’);

// Find the line with 🟣 (knowledge bar line)
const knowledgeBarLine = fileLines.find(line => line.includes('🟣'));

if (!knowledgeBarLine) continue;

// Skip if the line contains 𓂃𓂃𓂃
if (knowledgeBarLine.includes('𓂃𓂃𓂃')) {
    continue;
}

// Extract the first link (the leading file)
const firstLinkMatch = knowledgeBarLine.match(/\[\[([^\]]+)\]\]/);
if (!firstLinkMatch) continue;

// Parse the link
const linkContent = firstLinkMatch[1];
const linkTarget = linkContent.split('|')[0].trim();

// Get the current filename without extension
const currentFileName = p.file.name.replace(/\.md$/, '');

// Only process if this file is the leading file
if (linkTarget !== currentFileName) continue;

// Check each symbol individually
for (const symbol of symbols) {
    const hasBasic = knowledgeBarLine.includes("❪" + symbol + "❫");
    const hasSubscripted = knowledgeBarLine.includes("❪" + symbol) && !hasBasic;
    
    if (hasSubscripted && !hasBasic) {
        referenceFiles.push(currentFileName);
        break; // Only add the file once even if it has multiple symbols
    }
}

}

// Create sets for comparison
const bulletedFileSet = new Set(bulletedFiles);
const referenceFileSet = new Set(referenceFiles);

// Find mismatches
const inListNotInQuery = bulletedFiles.filter(f => !referenceFileSet.has(f));
const inQueryNotInList = referenceFiles.filter(f => !bulletedFileSet.has(f));

// Display results
dv.header(3, “Summary”);
dv.paragraph(Bulleted list files: ${bulletedFiles.length} items);
dv.paragraph(Reference query files: ${referenceFiles.length} items);

if (inListNotInQuery.length = 0 && inQueryNotInList.length = 0) {
dv.paragraph(”✅ Lists match perfectly!”);
} else {
dv.paragraph(”❌ Mismatches found:”);

if (inListNotInQuery.length > 0) {
    dv.header(4, "In list but NOT in query (remove these):");
    dv.list(inListNotInQuery.map(f => `[[${f}]]`));
}

if (inQueryNotInList.length > 0) {
    dv.header(4, "In query but NOT in list (add these):");
    dv.list(inQueryNotInList.map(f => `[[${f}]]`));
}

}
—>