diff --git a/LifeOS/install/LIFEOS/TOOLS/GenerateKnowledgeSchemaDoc.ts b/LifeOS/install/LIFEOS/TOOLS/GenerateKnowledgeSchemaDoc.ts index 95972f4e7b..ad570c5367 100755 --- a/LifeOS/install/LIFEOS/TOOLS/GenerateKnowledgeSchemaDoc.ts +++ b/LifeOS/install/LIFEOS/TOOLS/GenerateKnowledgeSchemaDoc.ts @@ -69,6 +69,8 @@ function render(): string { L.push(`| \`${t}\` | ${extra.length ? extra.map((k) => `\`${k}\``).join(", ") : "— (envelope only)"} |`); } L.push(""); + L.push("**Waived for internal notes.** A note with `source_kind: internal` has no external origin — it *is* the primary artifact (an own-prose capture, a design decision, a corpus this system built). Demanding a `source_url` of it asks for a URL that cannot exist, so `source_*` requirements above are skipped when `source_kind` is `internal`. Externally-sourced notes still must carry their provenance."); + L.push(""); L.push("A note missing an optional per-type source field (e.g. a research note with no `source_url`) is **envelope-conformant but incomplete** — Lint reports it as an enrichment gap, not a schema failure."); L.push(""); diff --git a/LifeOS/install/LIFEOS/TOOLS/KnowledgeSchema.ts b/LifeOS/install/LIFEOS/TOOLS/KnowledgeSchema.ts index 4e09f836e9..3e97143367 100755 --- a/LifeOS/install/LIFEOS/TOOLS/KnowledgeSchema.ts +++ b/LifeOS/install/LIFEOS/TOOLS/KnowledgeSchema.ts @@ -488,7 +488,14 @@ export function validate(parsed: ParsedNote, _slug: string, dirType: CanonicalTy // per-type required (present AND non-empty) const effType = ((CANONICAL_TYPES as readonly string[]).includes(t ?? "") ? t : dirType) as CanonicalType; + // `source_kind: internal` means the note has no external origin — it IS the + // primary artifact (a LifeOS corpus, a design decision, an own-prose capture). + // Demanding a source_url of it asks for a URL that cannot exist, so the + // source_* requirements are waived for internal notes. Externally-sourced + // notes still must carry their provenance. + const isInternal = deq(get("source_kind")) === "internal"; for (const key of PER_TYPE_REQUIRED[effType] ?? []) { + if (isInternal && key.startsWith("source_")) continue; if (missingOrEmpty(key)) v.push({ key, problem: `required for type ${effType}` }); }