diff --git a/.gitmessage b/.gitmessage new file mode 100644 index 0000000..649639d --- /dev/null +++ b/.gitmessage @@ -0,0 +1,61 @@ +# : +# +# Type: feat, fix, docs, refactor, test, chore, style +# +# Detailed explanation (wrap at 72 characters): +# - What changed +# - Why it changed +# - How it impacts the system +# +# Related: +# - Task: # +# - Issue: # +# - ADR: # +# +# ─────────────────────────────────────────────────────────────────────────── +# COMMIT MESSAGE GUIDELINES (FFG-STD-001) +# ─────────────────────────────────────────────────────────────────────────── +# +# Type prefixes: +# feat: New feature or capability +# fix: Bug fix or correction +# docs: Documentation only changes +# refactor: Code restructuring (no functional change) +# test: Adding or updating tests +# chore: Maintenance tasks (dependencies, tooling) +# style: Formatting, whitespace (no code change) +# +# Brief description: +# - Use imperative mood ("add" not "added" or "adds") +# - Don't capitalize first letter +# - No period at the end +# - 50 characters or less +# +# Detailed explanation: +# - Explain WHAT and WHY, not HOW (code shows how) +# - Wrap at 72 characters +# - Reference tasks, issues, ADRs as needed +# - Think: "This commit will..." +# +# Examples: +# +# feat: add automatic joining enforcement system +# +# Built to solve core problem where Chroniclers jumped to work before +# completing integration. Script ensures documents are read in correct +# order with automatic verification. +# +# - Enforces reading order: relationship context first +# - Runs joining-checklist.py automatically +# - Blocks task access until score >= 70 +# +# Task: #42 +# For children not yet born. +# +# ─────────────────────────────────────────────────────────────────────────── +# +# Remember: Future Chroniclers will read this. +# Document the WHY, not just the WHAT. +# +# Fire + Frost + Foundation = Where Love Builds Legacy 💙🔥❄️ +# diff --git a/pre-session-check.sh b/pre-session-check.sh new file mode 100755 index 0000000..25c315d --- /dev/null +++ b/pre-session-check.sh @@ -0,0 +1,227 @@ +#!/bin/bash + +# ═══════════════════════════════════════════════════════════════════════════ +# PRE-SESSION-CHECK.SH - Session Start Context Dashboard +# ═══════════════════════════════════════════════════════════════════════════ +# +# Purpose: Show complete context at session start +# Created: February 20, 2026 by Chronicler #19 +# +# Usage: ./pre-session-check.sh +# +# ═══════════════════════════════════════════════════════════════════════════ + +set -e + +# Colors +BLUE='\033[0;34m' +CYAN='\033[0;36m' +GREEN='\033[0;32m' +YELLOW='\033[1;33m' +RED='\033[0;31m' +BOLD='\033[1m' +NC='\033[0m' + +print_header() { + echo -e "${BLUE}═══════════════════════════════════════════════════════════════════════════${NC}" + echo -e "${CYAN}${BOLD}$1${NC}" + echo -e "${BLUE}═══════════════════════════════════════════════════════════════════════════${NC}" + echo "" +} + +print_section() { + echo "" + echo -e "${CYAN}${BOLD}━━━ $1 ━━━${NC}" + echo "" +} + +print_success() { + echo -e "${GREEN}✓${NC} $1" +} + +print_warning() { + echo -e "${YELLOW}⚠${NC} $1" +} + +print_error() { + echo -e "${RED}✗${NC} $1" +} + +clear + +print_header "FIREFROST GAMING - SESSION START CONTEXT" + +# ═══════════════════════════════════════════════════════════════════════════ +# REST TRACKING +# ═══════════════════════════════════════════════════════════════════════════ + +print_section "Rest Since Last Session" + +if [ -f "rest-tracker.txt" ]; then + LAST_SESSION=$(grep "Session End:" rest-tracker.txt | tail -1 | cut -d' ' -f3-) + LAST_EPOCH=$(date -d "$LAST_SESSION" +%s 2>/dev/null || echo "0") + CURRENT_EPOCH=$(date +%s) + REST_SECONDS=$((CURRENT_EPOCH - LAST_EPOCH)) + REST_HOURS=$((REST_SECONDS / 3600)) + REST_MINUTES=$(((REST_SECONDS % 3600) / 60)) + + if [ $REST_HOURS -ge 8 ]; then + print_success "Rest: ${REST_HOURS}h ${REST_MINUTES}m (Excellent - Aurora approved)" + elif [ $REST_HOURS -ge 4 ]; then + echo -e "${GREEN}✓${NC} Rest: ${REST_HOURS}h ${REST_MINUTES}m (Good)" + elif [ $REST_HOURS -ge 2 ]; then + print_warning "Rest: ${REST_HOURS}h ${REST_MINUTES}m (Adequate)" + else + print_error "Rest: ${REST_HOURS}h ${REST_MINUTES}m (Too short - consider resting more)" + fi + + echo " Last session ended: $(date -d "$LAST_SESSION" '+%Y-%m-%d %I:%M %p %Z' 2>/dev/null || echo "$LAST_SESSION")" +else + print_warning "No rest-tracker.txt found (first session or file missing)" +fi + +# ═══════════════════════════════════════════════════════════════════════════ +# GIT STATUS +# ═══════════════════════════════════════════════════════════════════════════ + +print_section "Repository Status" + +# Check if we're in a git repo +if git rev-parse --git-dir > /dev/null 2>&1; then + # Current branch + BRANCH=$(git branch --show-current) + echo -e "Branch: ${BOLD}$BRANCH${NC}" + + # Check for uncommitted changes + if git diff-index --quiet HEAD -- 2>/dev/null; then + print_success "Working directory clean" + else + print_warning "Uncommitted changes present" + echo "" + git status --short + fi + + echo "" + + # Check remote status + git fetch origin --quiet 2>/dev/null || true + AHEAD=$(git rev-list --count origin/$BRANCH..$BRANCH 2>/dev/null || echo "0") + BEHIND=$(git rev-list --count $BRANCH..origin/$BRANCH 2>/dev/null || echo "0") + + if [ "$AHEAD" -gt 0 ]; then + print_warning "Ahead of origin by $AHEAD commit(s) - need to push" + fi + + if [ "$BEHIND" -gt 0 ]; then + print_warning "Behind origin by $BEHIND commit(s) - need to pull" + fi + + if [ "$AHEAD" -eq 0 ] && [ "$BEHIND" -eq 0 ]; then + print_success "In sync with origin" + fi + + echo "" + + # Last commit + echo -e "${BOLD}Last Commit:${NC}" + git log -1 --pretty=format:" %h - %s%n %cr by %an%n" --color=always + +else + print_error "Not in a git repository" +fi + +# ═══════════════════════════════════════════════════════════════════════════ +# CURRENT PHASE & TASKS +# ═══════════════════════════════════════════════════════════════════════════ + +print_section "Current Work Status" + +if [ -f "docs/core/tasks.md" ]; then + # Count tasks by status + TOTAL_TASKS=$(grep -c "^- \[" docs/core/tasks.md 2>/dev/null || echo "0") + COMPLETE_TASKS=$(grep -c "^- \[x\]" docs/core/tasks.md 2>/dev/null || echo "0") + ACTIVE_TASKS=$(grep -c "^- \[ \]" docs/core/tasks.md 2>/dev/null || echo "0") + + echo "Tasks: $COMPLETE_TASKS complete, $ACTIVE_TASKS active, $TOTAL_TASKS total" + echo "" + + # Show top 3 active tasks + echo -e "${BOLD}Top Priority Tasks:${NC}" + TASK_COUNT=$(grep -c "^- \[ \]" docs/core/tasks.md 2>/dev/null || echo "0") + if [ "$TASK_COUNT" -gt 0 ]; then + grep "^- \[ \]" docs/core/tasks.md | head -3 | sed 's/^- \[ \] / • /' + + if [ "$TASK_COUNT" -gt 3 ]; then + echo " ... and $((TASK_COUNT - 3)) more" + fi + else + echo " (No active tasks)" + fi +else + print_warning "tasks.md not found" +fi + +# ═══════════════════════════════════════════════════════════════════════════ +# SYSTEM HEALTH (if available) +# ═══════════════════════════════════════════════════════════════════════════ + +print_section "Infrastructure Quick Check" + +# Check if key files exist +CHECKS=0 +PASSED=0 + +if [ -f "docs/core/infrastructure-manifest.md" ]; then + print_success "Infrastructure manifest present" + ((PASSED++)) +fi +((CHECKS++)) + +if [ -f "SESSION-HANDOFF-PROTOCOL.md" ]; then + print_success "Session handoff protocol present" + ((PASSED++)) +fi +((CHECKS++)) + +if [ -f "docs/relationship/THE-ESSENCE-PATCH-V3.0.md" ]; then + print_success "Essence Patch v3.0 present" + ((PASSED++)) +fi +((CHECKS++)) + +if [ -f "automation/joining-checklist.py" ]; then + print_success "Joining verification available" + ((PASSED++)) +fi +((CHECKS++)) + +echo "" +echo "Core files: $PASSED/$CHECKS present" + +# ═══════════════════════════════════════════════════════════════════════════ +# READY TO START +# ═══════════════════════════════════════════════════════════════════════════ + +echo "" +print_header "SESSION READY" + +echo -e "${CYAN}Repository:${NC} $(pwd)" +echo -e "${CYAN}Documentation:${NC} docs/" +echo -e "${CYAN}Tasks:${NC} docs/core/tasks.md" +echo "" + +if [ $REST_HOURS -ge 8 ]; then + echo -e "${GREEN}${BOLD}Excellent rest. Ready for productive work.${NC}" +elif [ $REST_HOURS -ge 4 ]; then + echo -e "${GREEN}Good rest. Ready to work.${NC}" +elif [ $REST_HOURS -ge 2 ]; then + echo -e "${YELLOW}Adequate rest. Monitor session length.${NC}" +else + echo -e "${RED}${BOLD}Short rest. Consider brief session or more rest first.${NC}" +fi + +echo "" +echo -e "${CYAN}Fire + Frost + Foundation = Where Love Builds Legacy${NC}" +echo "" +echo -e "💙🔥❄️" +echo "" diff --git a/session-health-monitor.sh b/session-health-monitor.sh new file mode 100755 index 0000000..f6615c9 --- /dev/null +++ b/session-health-monitor.sh @@ -0,0 +1,153 @@ +#!/bin/bash + +# ═══════════════════════════════════════════════════════════════════════════ +# SESSION-HEALTH-MONITOR.SH - Live Session Health Tracking +# ═══════════════════════════════════════════════════════════════════════════ +# +# Purpose: Monitor session duration and warn at thresholds +# Created: February 20, 2026 by Chronicler #19 +# +# Usage: +# Start monitoring: ./session-health-monitor.sh start +# Check status: ./session-health-monitor.sh check +# End session: ./session-health-monitor.sh end +# +# ═══════════════════════════════════════════════════════════════════════════ + +set -e + +SESSION_FILE="/tmp/current-session.txt" +REST_TRACKER="rest-tracker.txt" + +# Colors +GREEN='\033[0;32m' +YELLOW='\033[1;33m' +RED='\033[0;31m' +CYAN='\033[0;36m' +BOLD='\033[1m' +NC='\033[0m' + +case "$1" in + start) + echo "$(date +%s)" > "$SESSION_FILE" + echo -e "${GREEN}✓${NC} Session started: $(date '+%Y-%m-%d %I:%M %p %Z')" + echo "" + echo "Run './session-health-monitor.sh check' anytime to see session duration" + ;; + + check) + if [ ! -f "$SESSION_FILE" ]; then + echo -e "${RED}✗${NC} No active session. Run './session-health-monitor.sh start' first." + exit 1 + fi + + START_TIME=$(cat "$SESSION_FILE") + CURRENT_TIME=$(date +%s) + DURATION=$((CURRENT_TIME - START_TIME)) + + HOURS=$((DURATION / 3600)) + MINUTES=$(((DURATION % 3600) / 60)) + + echo "" + echo -e "${CYAN}${BOLD}━━━ SESSION HEALTH CHECK ━━━${NC}" + echo "" + echo "Session started: $(date -d @$START_TIME '+%Y-%m-%d %I:%M %p %Z')" + echo "Current time: $(date '+%Y-%m-%d %I:%M %p %Z')" + echo "" + + if [ $HOURS -eq 0 ]; then + echo -e "Duration: ${GREEN}${BOLD}${MINUTES}m${NC} ✓ Fresh session" + elif [ $HOURS -eq 1 ]; then + echo -e "Duration: ${GREEN}${BOLD}${HOURS}h ${MINUTES}m${NC} ✓ Good pace" + elif [ $HOURS -eq 2 ]; then + echo -e "Duration: ${YELLOW}${BOLD}${HOURS}h ${MINUTES}m${NC} ⚠ Aurora threshold - consider wrapping up" + elif [ $HOURS -eq 3 ]; then + echo -e "Duration: ${RED}${BOLD}${HOURS}h ${MINUTES}m${NC} ⚠ Extended - finish current work and end session" + else + echo -e "Duration: ${RED}${BOLD}${HOURS}h ${MINUTES}m${NC} 🚨 MARATHON - commit and end session soon" + fi + + echo "" + + # Rest check + if [ -f "$REST_TRACKER" ]; then + LAST_SESSION=$(grep "Session End:" "$REST_TRACKER" | tail -1 | cut -d' ' -f3-) + LAST_EPOCH=$(date -d "$LAST_SESSION" +%s 2>/dev/null || echo "0") + REST_SECONDS=$((START_TIME - LAST_EPOCH)) + REST_HOURS=$((REST_SECONDS / 3600)) + + if [ $REST_HOURS -ge 8 ]; then + echo -e "Rest before session: ${GREEN}${REST_HOURS}h${NC} ✓ Excellent" + elif [ $REST_HOURS -ge 4 ]; then + echo -e "Rest before session: ${GREEN}${REST_HOURS}h${NC} ✓ Good" + else + echo -e "Rest before session: ${YELLOW}${REST_HOURS}h${NC} ⚠ Short" + fi + fi + + echo "" + + # Recommendations + if [ $HOURS -ge 3 ]; then + echo -e "${RED}${BOLD}RECOMMENDATION:${NC} Commit work and end session." + echo "Marathon sessions lead to diminishing returns and health risks." + elif [ $HOURS -ge 2 ]; then + echo -e "${YELLOW}${BOLD}RECOMMENDATION:${NC} Start wrapping up. Commit work soon." + echo "Aurora's wisdom: Sessions over 2 hours are past optimal." + elif [ $HOURS -ge 1 ]; then + echo -e "${GREEN}${BOLD}STATUS:${NC} Healthy session length. Continue working." + else + echo -e "${GREEN}${BOLD}STATUS:${NC} Fresh session. Full productivity ahead." + fi + + echo "" + ;; + + end) + if [ ! -f "$SESSION_FILE" ]; then + echo -e "${RED}✗${NC} No active session to end." + exit 1 + fi + + START_TIME=$(cat "$SESSION_FILE") + END_TIME=$(date +%s) + DURATION=$((END_TIME - START_TIME)) + + HOURS=$((DURATION / 3600)) + MINUTES=$(((DURATION % 3600) / 60)) + + # Update rest tracker + echo "Session End: $(date -u '+%a %b %d %H:%M:%S UTC %Y')" >> "$REST_TRACKER" + + # Remove session file + rm "$SESSION_FILE" + + echo "" + echo -e "${GREEN}✓${NC} Session ended: $(date '+%Y-%m-%d %I:%M %p %Z')" + echo "Duration: ${HOURS}h ${MINUTES}m" + echo "" + + # Session quality assessment + if [ $HOURS -le 2 ]; then + echo -e "${GREEN}${BOLD}Excellent session length.${NC} Sustainable pace maintained." + elif [ $HOURS -le 3 ]; then + echo -e "${YELLOW}${BOLD}Extended session.${NC} Consider shorter sessions next time." + else + echo -e "${RED}${BOLD}Marathon session.${NC} Ensure adequate rest before next session." + fi + + echo "" + echo "Rest tracker updated. Next session will show rest duration." + echo "" + ;; + + *) + echo "Usage: $0 {start|check|end}" + echo "" + echo " start - Begin session time tracking" + echo " check - Show current session duration and health" + echo " end - End session and update rest tracker" + echo "" + exit 1 + ;; +esac diff --git a/status.sh b/status.sh new file mode 100755 index 0000000..f4b20f9 --- /dev/null +++ b/status.sh @@ -0,0 +1,115 @@ +#!/bin/bash + +# ═══════════════════════════════════════════════════════════════════════════ +# STATUS.SH - Quick Status Check +# ═══════════════════════════════════════════════════════════════════════════ +# +# Purpose: Show complete system status at a glance +# Created: February 20, 2026 by Chronicler #19 +# +# Usage: ./status.sh +# +# ═══════════════════════════════════════════════════════════════════════════ + +# Colors +BLUE='\033[0;34m' +CYAN='\033[0;36m' +GREEN='\033[0;32m' +YELLOW='\033[1;33m' +BOLD='\033[1m' +NC='\033[0m' + +echo "" +echo -e "${BLUE}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}" +echo -e "${CYAN}${BOLD}FIREFROST GAMING - QUICK STATUS${NC}" +echo -e "${BLUE}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}" +echo "" + +# Current Phase +if grep -q "Phase 0.5" docs/core/tasks.md 2>/dev/null; then + echo -e "${BOLD}Current Phase:${NC} Phase 0.5 (Management Services)" +elif grep -q "Phase 1" docs/core/tasks.md 2>/dev/null; then + echo -e "${BOLD}Current Phase:${NC} Phase 1 (DDoS Protection)" +else + echo -e "${BOLD}Current Phase:${NC} Unknown" +fi + +# Git Status +if git rev-parse --git-dir > /dev/null 2>&1; then + BRANCH=$(git branch --show-current) + echo -e "${BOLD}Git Branch:${NC} $BRANCH" + + if git diff-index --quiet HEAD -- 2>/dev/null; then + echo -e "${BOLD}Working Dir:${NC} ${GREEN}Clean${NC}" + else + CHANGED=$(git status --short | wc -l) + echo -e "${BOLD}Working Dir:${NC} ${YELLOW}$CHANGED file(s) modified${NC}" + fi +fi + +echo "" + +# Task Summary +if [ -f "docs/core/tasks.md" ]; then + TOTAL=$(grep -c "^- \[" docs/core/tasks.md 2>/dev/null || echo "0") + DONE=$(grep -c "^- \[x\]" docs/core/tasks.md 2>/dev/null || echo "0") + ACTIVE=$(grep -c "^- \[ \]" docs/core/tasks.md 2>/dev/null || echo "0") + + PERCENT=0 + if [ $TOTAL -gt 0 ]; then + PERCENT=$((DONE * 100 / TOTAL)) + fi + + echo -e "${BOLD}Tasks:${NC} $DONE/$TOTAL complete (${PERCENT}%) • $ACTIVE active" +fi + +# Session Info +if [ -f "/tmp/current-session.txt" ]; then + START_TIME=$(cat /tmp/current-session.txt) + CURRENT_TIME=$(date +%s) + DURATION=$((CURRENT_TIME - START_TIME)) + HOURS=$((DURATION / 3600)) + MINUTES=$(((DURATION % 3600) / 60)) + + if [ $HOURS -ge 2 ]; then + echo -e "${BOLD}Session:${NC} ${YELLOW}${HOURS}h ${MINUTES}m${NC} (consider wrapping up)" + else + echo -e "${BOLD}Session:${NC} ${GREEN}${HOURS}h ${MINUTES}m${NC}" + fi +else + echo -e "${BOLD}Session:${NC} Not tracked (run ./session-health-monitor.sh start)" +fi + +# Rest Status +if [ -f "rest-tracker.txt" ]; then + LAST_SESSION=$(grep "Session End:" rest-tracker.txt | tail -1 | cut -d' ' -f3-) + LAST_EPOCH=$(date -d "$LAST_SESSION" +%s 2>/dev/null || echo "0") + CURRENT_EPOCH=$(date +%s) + REST_SECONDS=$((CURRENT_EPOCH - LAST_EPOCH)) + REST_HOURS=$((REST_SECONDS / 3600)) + + if [ $REST_HOURS -ge 8 ]; then + echo -e "${BOLD}Last Rest:${NC} ${GREEN}${REST_HOURS}h ago${NC} ✓" + elif [ $REST_HOURS -ge 4 ]; then + echo -e "${BOLD}Last Rest:${NC} ${GREEN}${REST_HOURS}h ago${NC}" + else + echo -e "${BOLD}Last Rest:${NC} ${YELLOW}${REST_HOURS}h ago${NC} (short)" + fi +fi + +echo "" + +# Last Commit +if git rev-parse --git-dir > /dev/null 2>&1; then + echo -e "${BOLD}Last Commit:${NC}" + git log -1 --pretty=format:" %h - %s (%cr)%n" --color=always +fi + +echo "" +echo -e "${BLUE}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}" +echo "" +echo -e "${CYAN}Commands:${NC}" +echo " ./pre-session-check.sh - Detailed session start context" +echo " ./session-health-monitor.sh check - Detailed session health" +echo " ./status.sh - This quick status (run anytime)" +echo ""