refactor(linkedin-studio): M0-10 — content-filter recognizes external drafts (after negatives, before infraDirs)

This commit is contained in:
Kjell Tore Guttormsen 2026-06-18 11:50:04 +02:00
commit 2e2a8c5d60
2 changed files with 40 additions and 1 deletions

View file

@ -23,9 +23,16 @@ export function isLinkedInContent(filePath) {
const nonContent = ['.local.md', 'CLAUDE.md', 'README.md', 'CHANGELOG.md', 'REMEMBER.md', 'BACKLOG.md', 'DEVELOPMENT-LOG.md'];
if (nonContent.some(n => base.endsWith(n) || base === n)) return false;
const normalized = filePath.replace(/\\/g, '/');
// POSITIVE (external): relocated drafts under the per-user data root are the
// only external data class the Write/Edit quality gate guards (voice-samples /
// analytics / profile are not editor-gated content). Must come BEFORE the
// infraDirs negative below, which would otherwise reject any /.claude/ path.
if (normalized.startsWith('.claude/linkedin-studio/drafts/') || normalized.includes('/.claude/linkedin-studio/drafts/')) return true;
// NEGATIVE: infrastructure paths
const infraDirs = ['hooks', 'scripts', 'config', 'commands', 'agents', 'skills', 'references', 'docs', '.claude', '.claude-plugin', 'node_modules'];
const normalized = filePath.replace(/\\/g, '/');
for (const dir of infraDirs) {
if (normalized.startsWith(dir + '/') || normalized.includes('/' + dir + '/')) return false;
}