Some checks are pending
- Extracts full frontmatter metadata (originalDate, notion_*, authors, source) - Correct date priority: frontmatter → filename → mtime → ctime - All metadata exposed in index.json for frontend use Phase 1 quick win complete.
3.4 KiB
3.4 KiB
The Coherence Loop
Overview
The Coherence Loop is a recursive self-improvement system for The Fold Within Earth website. It continuously monitors, diagnoses, and automatically fixes coherence issues in the site's content and infrastructure.
How It Works
1. Watcher - GitHub Actions Monitoring
The system uses GitHub Actions to monitor site health on multiple schedules:
- Every 4 hours: Full coherence validation
- Daily at midnight: Comprehensive report generation
- On push/PR: Validation of changes
2. Diagnoser - Automated Issue Identification
The diagnostic layer checks:
- Frontmatter completeness: Validates required fields in all fieldnotes
- Metadata integrity: Ensures metadata.yaml files are valid and complete
- Link coherence: Detects broken internal and external links
- File structure: Verifies content follows expected patterns
3. Fixer - Auto-Patching Common Issues
When issues are tagged with needs-auto-fix, the system can:
- Add missing frontmatter templates
- Fix metadata formatting issues
- Regenerate index files
- Create pull requests with fixes
4. Witness - Human Review Validation
Human reviewers validate improvements through:
- Pull request reviews
- Issue triage
- Project board management
- Discussion participation
Cycles
Automated Cycle (Every 4 Hours)
graph TD
A[Watcher: Check triggers] --> B[Diagnoser: Run validation]
B --> C{Issues found?}
C -->|Yes| D[Fixer: Create auto-fix PR]
C -->|No| E[Report: Log success]
D --> F[Witness: Human review]
F --> G[Merge if approved]
E --> A
Daily Cycle (Midnight)
- Generate comprehensive coherence report
- Post to GitHub Discussions
- Update project board with new issues
- Archive completed items
Weekly Cycle (Full Review)
- Review all open PRs
- Audit project board columns
- Update documentation
- Refine automation rules
Roles
| Role | Actor | Responsibilities |
|---|---|---|
| Developer | GitHub Actions | Automated checks, fixes, reporting |
| Tester | Automated scripts | Validation, link checking, schema verification |
| User | Community members | Issue reporting, feedback |
| Witness | Human reviewers | PR review, triage, quality assurance |
Metrics
The system tracks:
- Coherence Score: Overall site health (0-100)
- Issue Density: Issues per content file
- Fix Rate: Automated vs manual fixes
- Response Time: Time from issue to resolution
Configuration
Workflow Files
.github/workflows/coherence-check.yml- Primary validation.github/workflows/auto-fix.yml- Automated fixes.github/workflows/daily-report.yml- Daily reporting
Scripts
tools/coherence-check.py- Main validation scripttools/generate-index.mjs- Index generation with validation
Templates
docs/fieldnote-template.md- Frontmatter templatedocs/coherence-system.md- This documentation
Getting Started
Reporting Issues
- Use the "Coherence Issue" template
- Select the appropriate error type and severity
- Provide clear reproduction steps
Contributing Fixes
- Fork the repository
- Create a feature branch
- Make your changes
- Run
python tools/coherence-check.pylocally - Submit a PR
Support
- Documentation: See
docs/folder - Discussions: Use GitHub Discussions
- Issues: Open a GitHub issue