Data Integrity Patterns

Patterns for maintaining data consistency and preventing drift in knowledge systems.

Cross-Reference Validation Pattern

Verify all internal links before adding or modifying content:

## Before Adding a Link
 
1. Check target exists: `ls obsidian/path/to/target.md`
2. Verify frontmatter matches expected type
3. Add bidirectional link in target if appropriate

When to Apply: Every time you add a [[wikilink]] or markdown link to another page.

Anti-pattern: Creating links to pages that don’t exist, expecting them to be created later.

Single Source of Truth Pattern

Maintain one authoritative source for each piece of data:

Data TypeSingle SourceConsumers
Project status.management/knowledge.md in each repoproject-status.md
Technical debtProject .management/knowledge.mdtechnical-debt.md registry
Version infoFrontmatter in project pageIndex pages, dashboards
Research outcomesresearch/completed/*.mdProject pages

Sync Rule: Aggregated views pull from sources; never manually edit aggregated data.

# Good: Sync from source
python scripts/sync-knowledge.py
 
# Bad: Manual edit in aggregated file
# This will be overwritten on next sync

Stub Page Lifecycle Pattern

When a 404 is detected, follow this lifecycle instead of creating empty stubs:

┌─────────────────────────────────────────────────────┐
│ 1. 404 DETECTED                                     │
│    └─→ Check if page should exist                   │
│        ├─→ No: Remove the broken link               │
│        └─→ Yes: Continue to step 2                  │
├─────────────────────────────────────────────────────┤
│ 2. LOCATE SOURCE CONTENT                            │
│    └─→ Find authoritative source for this content   │
│        ├─→ Found: Create page with real content     │
│        └─→ Not found: Create as "draft" with TODO   │
├─────────────────────────────────────────────────────┤
│ 3. DRAFT PAGE (if source not found)                 │
│    status: draft                                    │
│    tags: [needs-content]                            │
│    Body: "TODO: Source content from X"              │
├─────────────────────────────────────────────────────┤
│ 4. REVIEW DRAFTS                                    │
│    Quarterly audit of all status: draft pages       │
│    Either populate or delete                        │
└─────────────────────────────────────────────────────┘

Anti-pattern: Creating stub pages with placeholder content like “Coming soon” or “TBD”.

Frontmatter Consistency Pattern

Required frontmatter fields by content type:

Content TypeRequired Fields
projecttitle, created, updated, type, status, version
researchtitle, created, updated, type, status, outcome
referencetitle, created, updated, type, tags
registrytitle, created, updated, type, source

Validation Checks:

  1. status must be one of: draft, active, completed, archived
  2. version must follow semver pattern: v1.0, v0.3
  3. updated must be ≥ created
  4. source for synced content must reference a valid path

Quarterly Audit Checklist

Run this checklist every quarter:

  • Run link validation: npm run validate:links
  • Check for stale sync timestamps (>30 days)
  • Verify project-status.md against source repos
  • Review all status: draft pages
  • Check for orphaned pages (no incoming links)
  • Validate frontmatter consistency
  • Update index pages if projects added/removed

Audit Findings (January 2026)

Lessons learned from the comprehensive Knowledge Vault audit:

Sync Process Duplicate Prevention

The ops-core sync process can create duplicates when research moves from active to completed:

IssueCausePrevention
Duplicate research docsActive and completed versions synced separatelySync script should check for existing file in alternate directory before creating
Status mismatchActive version not deleted when completed syncedInclude cleanup step in sync process

Pattern: Before syncing a research document, check if it exists in the opposite status directory (active vs completed). If completed version exists, skip or delete the active version.

Links to project pages can break when:

  1. New Library submodules added without corresponding project pages
  2. Project page paths referenced before creation
  3. Renamed projects with outdated references

Prevention: Run link validation after adding new submodules or project references.

Blog Publication Workflow

Blog posts require explicit status updates:

StatusMeaning
draftWork in progress, not ready for publication
publishedComplete content, ready for public consumption

Pattern: Complete content + status: draft = needs review. Update to status: published after final review.

Best Practices

PracticeWhy
Validate before commitCatch broken links early
Use source syncingPrevents manual drift
Never create empty stubsBetter to fix the link
Quarterly auditsCatch accumulated drift
Bidirectional linkingImproves discoverability
Check for duplicatesSync can create pairs
Explicit publicationBlog posts need workflow