Prompt file imported from thaddiusatme/inneros-zettelkasten (
.windsurf/workflows/fleeting-note-lifecycle-workflow.md). Copyright stays with the author.
Fleeting Note Lifecycle Workflow: Phase 5.6 Extension
Purpose: Systematic TDD implementation of fleeting note lifecycle management
Integration: Extends existing Phase 5 AI workflows and WorkflowManager infrastructure
Reference:Projects/fleeting-note-lifecycle-mvp-manifest.md
๐ฏ Workflow Overview
Project Type: Phase 5.6 Integration Extension
- Extends: Existing WorkflowManager, CLI infrastructure, AI processing pipeline
- Preserves: All existing functionality (66/66 tests must remain passing)
- Adds: Systematic fleeting note aging, quality triage, promotion workflows
- Follows: Integration Project Workflow methodology
Implementation Philosophy
- TDD-First: Red โ Green โ Refactor cycles for all new features
- Integration-First: Build on existing infrastructure, don't duplicate
- Safety-First: Use proven DirectoryOrganizer patterns with backups
- User-First: Follow existing CLI patterns and output formatting
๐ Phase Implementation Workflow
Phase 1: Foundation (Week 1)
Goal: Implement US-1 Fleeting Note Age Detection
Step 1: Pre-Implementation Validation
// turbo
# Ensure clean baseline before starting
cd /Users/thaddius/repos/inneros-zettelkasten
python3 -m pytest development/tests/ -v
Expected: All existing tests pass (establish baseline)
Step 2: TDD RED Phase - Create Failing Tests
# Create test file for fleeting analysis features
touch development/tests/unit/test_fleeting_lifecycle.py
# Write failing tests for:
# - FleetingAnalysis data structure
# - analyze_fleeting_notes() method
# - generate_fleeting_health_report() method
# - CLI --fleeting-health integration
Step 3: TDD GREEN Phase - Minimal Implementation
# Extend WorkflowManager with minimal fleeting methods
# Add CLI flag to dedicated fleeting_cli.py (ADR-004)
# Implement just enough to pass tests
# Verify tests pass:
python3 -m pytest development/tests/unit/test_fleeting_lifecycle.py -v
Step 4: TDD REFACTOR Phase - Enhanced Features
# Add error handling, performance optimization
# Enhance output formatting to match existing patterns
# Add comprehensive docstrings and type hints
# Verify all tests still pass:
python3 -m pytest development/tests/ -v
Step 5: Real Data Validation
# Test with actual fleeting notes collection
python3 development/src/cli/fleeting_cli.py fleeting-health
# Verify performance <3 seconds
time python3 development/src/cli/fleeting_cli.py fleeting-health
Step 6: Documentation & Integration
# Update CLI reference
# Add to README.md
# Document integration patterns used
# Commit clean implementation
git add -A
git commit -m "feat(fleeting): implement age detection and health reporting (US-1)
- Add WorkflowManager.analyze_fleeting_notes() method
- Add WorkflowManager.generate_fleeting_health_report() method
- Add CLI --fleeting-health flag with summary stats
- Include TDD test suite with 5-8 comprehensive tests
- Performance: <3 seconds for 100+ notes
- Integration: Uses existing metadata parsing, follows CLI patterns"
Phase 2: AI Triage (Week 1-2)
Goal: Implement US-2 Quality-Based Fleeting Triage
TDD Process:
- RED: Tests for AI-powered triage recommendations
- GREEN: Integration with existing quality scoring pipeline
- REFACTOR: Checklist output formatting, JSON export support
Key Integration Points:
- Reuse
process_inbox_note()quality scoring infrastructure - Follow
generate_weekly_recommendations()patterns - Use existing AI graceful fallback mechanisms
Phase 3: Promotion Workflow (Week 2)
Goal: Implement US-3 Simple Promotion Workflow
TDD Process:
- RED: Tests for safe fleeting note promotion
- GREEN: Integration with DirectoryOrganizer (P0+P1 system)
- REFACTOR: Comprehensive safety features and validation
Key Integration Points:
- Use existing
promote_note()method with fleeting routing - Leverage DirectoryOrganizer backup and rollback capabilities
- Maintain existing link integrity preservation (P0-3 system)
๐ง Technical Implementation Patterns
Extend WorkflowManager (Don't Replace)
class WorkflowManager:
# Existing methods - PRESERVE ALL โ
def __init__(self, ...)
def process_inbox_note(self, ...)
def generate_weekly_recommendations(self, ...)
def promote_note(self, ...)
# NEW: Fleeting lifecycle extensions โ
def analyze_fleeting_notes(self) -> FleetingAnalysis:
"""Scan fleeting notes and analyze age distribution."""
def generate_fleeting_health_report(self) -> Dict:
"""Generate health report for fleeting notes collection."""
def generate_fleeting_triage_recommendations(self) -> Dict:
"""Generate AI-powered triage recommendations."""
def promote_fleeting_note(self, note_path: str) -> Dict:
"""Safely promote fleeting note to permanent status."""
CLI Integration Pattern
# Use dedicated fleeting_cli.py (ADR-004, October 2025)
# Commands available:
python3 development/src/cli/fleeting_cli.py fleeting-health
python3 development/src/cli/fleeting_cli.py fleeting-triage
python3 development/src/cli/fleeting_cli.py promote-note PATH
# Core workflow commands in core_workflow_cli.py:
python3 development/src/cli/core_workflow_cli.py promote note.md permanent
Data Structure Patterns
# Follow existing dataclass patterns from analytics.py
@dataclass
class FleetingAnalysis:
total_notes: int
age_distribution: Dict[str, int]
oldest_note: Optional[Dict]
recommendations_count: int
generated_at: str
๐งช Testing Strategy
Unit Tests (Following Existing Patterns)
# development/tests/unit/test_fleeting_lifecycle.py
class TestFleetingLifecycle:
def test_analyze_fleeting_notes_empty_directory(self):
def test_analyze_fleeting_notes_with_valid_notes(self):
def test_generate_health_report_structure(self):
def test_age_categorization_accuracy(self):
def test_cli_fleeting_health_integration(self):
Integration Tests
# development/tests/integration/test_fleeting_integration.py
class TestFleetingIntegration:
def test_fleeting_triage_uses_existing_ai_pipeline(self):
def test_promotion_uses_directory_organizer_safety(self):
def test_performance_benchmarks_maintained(self):
Performance Validation
# Benchmark commands (must maintain existing performance)
time python3 development/src/cli/weekly_review_cli.py weekly-review
time python3 development/src/cli/fleeting_cli.py fleeting-health
time python3 development/src/cli/fleeting_cli.py fleeting-triage
๐ Safety & Validation Checklist
Before Each Phase
- All existing tests pass (66/66 baseline)
- Performance benchmarks established
- No breaking changes to existing CLI commands
- Git working directory clean
During Implementation
- TDD cycles followed strictly (Red โ Green โ Refactor)
- Integration patterns match existing code style
- Error handling follows established patterns
- Documentation updated incrementally
After Each Phase
- All tests pass including new ones
- Performance targets met (<3s health, <10s triage, <5s promotion)
- Real data validation successful
- Git commit with clear description
๐ Success Validation
Functional Validation
# Phase 1: Age detection working
python3 development/src/cli/fleeting_cli.py fleeting-health
# Should show: total notes, age distribution, oldest note, <3s execution
# Phase 2: AI triage working
python3 development/src/cli/fleeting_cli.py fleeting-triage
# Should show: promotion recommendations, rationale, confidence scores
# Phase 3: Promotion working
python3 development/src/cli/fleeting_cli.py promote-note "Fleeting Notes/test.md"
# Should: move file safely, preserve links, update metadata
Integration Validation
# Ensure existing workflows unaffected
python3 development/src/cli/weekly_review_cli.py weekly-review
python3 development/src/cli/core_workflow_cli.py process-inbox
python3 development/src/cli/weekly_review_cli.py enhanced-metrics
# All should work exactly as before
Performance Validation
# Measure and compare to baseline
time python3 development/src/cli/analytics_demo.py . --interactive
# Should maintain existing performance benchmarks
๐ฏ User Acceptance Criteria
Phase 1: Health Reporting
- User can quickly see which fleeting notes are getting stale
- Clear age categorization (New/Recent/Stale/Old) with counts
- Identify oldest notes requiring immediate attention
- Fast execution encourages regular use
Phase 2: AI Triage
- User gets actionable recommendations for fleeting note promotion
- AI rationale helps decision-making confidence
- Checklist format matches familiar weekly review workflow
- JSON export enables automation integration
Phase 3: Promotion Workflow
- User can safely promote notes with confidence (no data loss)
- Links preserved automatically during file moves
- Quick single-command promotion for high-quality notes
- Integration with weekly review reduces manual overhead
๐ Maintenance & Evolution
Monitoring Health
# Weekly validation of fleeting lifecycle health
python3 development/src/cli/fleeting_cli.py fleeting-health --export fleeting-health-$(date +%Y-%m-%d).md
# Track progression metrics over time
python3 development/src/cli/analytics_demo.py . --fleeting-trends
Iterative Improvements
- Phase 4: Bulk operations for batch fleeting management
- Phase 5: Archive workflow for outdated fleeting notes
- Phase 6: Integration with calendar for time-based workflows
Integration Evolution
- Monitor integration health with existing Phase 5 features
- Track user adoption of new fleeting commands
- Measure impact on overall knowledge graph quality
This workflow ensures systematic, safe implementation of fleeting note lifecycle management that enhances rather than disrupts the existing production-ready InnerOS Zettelkasten system.
