blue/.blue/docs/rfcs/0022-filesystem-authority.plan.md
Eric Garcia 0fea499957 feat: lifecycle suffixes for all document states + resolve all clippy warnings
Every document filename now mirrors its lifecycle state with a status
suffix (e.g., .draft.md, .wip.md, .accepted.md). No more bare .md for
tracked document types. Also renamed all from_str methods to parse to
avoid FromStr trait confusion, introduced StagingDeploymentParams struct,
and fixed all 19 clippy warnings across the codebase.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-26 12:19:46 -05:00

1.3 KiB

Plan: Filesystem Authority

RFC Filesystem Authority
Status complete
Updated 2026-01-26T02:38:21.586730+00:00

Tasks

  • Add content_hash and indexed_at columns to documents table (migration)
  • Implement hash_content() for staleness detection
  • Implement is_stale() with mtime fast path and hash slow path
  • Implement scan_and_register() to parse frontmatter and create DB record from file
  • Implement find_document() fallback to filesystem scan when DB lookup fails
  • Add slug-based document lookup (kebab-case title matching)
  • Implement scan_filesystem_max() for filesystem-aware numbering
  • Modify next_number() to use max(db, fs) + 1
  • Implement reconcile() for blue sync - scan filesystem and register unindexed files
  • Implement orphan detection - soft-delete records for missing files
  • Add --dry-run flag to blue sync
  • Update blue status to detect and warn about index drift
  • Add blue.db to .gitignore
  • Write core authority tests (delete DB rebuild, manual file creation, hash mismatch)
  • Write document lookup tests (slug matching, file-only creation)
  • Write numbering tests (empty DB, max of both sources, missing directory)
  • Write sync tests (unindexed files, orphan records, dry-run, drift warning)