-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmigrate-docs.sh
More file actions
executable file
·228 lines (182 loc) · 9.22 KB
/
migrate-docs.sh
File metadata and controls
executable file
·228 lines (182 loc) · 9.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
#!/bin/bash
# Safe migration of docs/ to Obsidian with frontmatter
# All original files remain untouched
set -e
OBSIDIAN_ROOT="workspace/docs/Obsidian"
REPO_DOCS="docs"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "📁 DOCS MIGRATION TO OBSIDIAN"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo ""
echo "45 files → Organized with frontmatter"
echo "Original files: KEPT (not deleted)"
echo ""
# Create Obsidian folders
mkdir -p "$OBSIDIAN_ROOT/archive/2025-10"
mkdir -p "$OBSIDIAN_ROOT/docs/reports"
mkdir -p "$OBSIDIAN_ROOT/docs/plans"
mkdir -p "$OBSIDIAN_ROOT/docs/reference"
mkdir -p "$OBSIDIAN_ROOT/docs/Memory"
# Counter
total=0
# Function to add frontmatter and copy
migrate_file() {
local src="$1"
local dest="$2"
local title="$3"
local type="$4"
local status="$5"
local labels="$6"
if [ ! -f "$src" ]; then
return
fi
total=$((total + 1))
# Create temp file with frontmatter
temp_file=$(mktemp)
cat > "$temp_file" <<EOF
---
title: "$title"
type: $type
agent: governor
status: $status
labels: [$labels]
related: []
---
EOF
# Append original content
cat "$src" >> "$temp_file"
# Copy to destination
cp "$temp_file" "$dest"
rm "$temp_file"
echo " ✅ $(basename "$src")"
}
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "Step 1: Session Summaries → archive/2025-10/"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
# Session summaries (dated files)
for file in "$REPO_DOCS"/SESSION-SUMMARY-*.md \
"$REPO_DOCS"/*2025-10-1[67]*.md \
"$REPO_DOCS"/CLEANUP-*.md \
"$REPO_DOCS"/GOVERNOR-COVE-*.md; do
if [ -f "$file" ]; then
filename=$(basename "$file" .md)
migrate_file "$file" "$OBSIDIAN_ROOT/archive/2025-10/$(basename "$file")" \
"$filename" "report" "archived" "session, archive"
fi
done
echo ""
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "Step 2: Integration Reports → docs/reports/"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
# Integration reports
migrate_file "$REPO_DOCS/AFS-INTEGRATION-COMPLETE.md" \
"$OBSIDIAN_ROOT/docs/reports/AFS-INTEGRATION-COMPLETE.md" \
"AFS Integration Complete" "report" "active" "report, afs, integration"
migrate_file "$REPO_DOCS/COVE-WORKFLOW-IMPLEMENTATION.md" \
"$OBSIDIAN_ROOT/docs/reports/COVE-WORKFLOW-IMPLEMENTATION.md" \
"Cove Workflow Implementation" "report" "active" "report, cove, workflow"
migrate_file "$REPO_DOCS/DSPY-TRAINING-EXAMPLES-INTEGRATION.md" \
"$OBSIDIAN_ROOT/docs/reports/DSPY-TRAINING-EXAMPLES-INTEGRATION.md" \
"DSPy Training Examples Integration" "report" "active" "report, dspy, training"
migrate_file "$REPO_DOCS/DSPY-TRAINING-INGESTION-COMPLETE-2025-10-19.md" \
"$OBSIDIAN_ROOT/docs/reports/DSPY-TRAINING-INGESTION-COMPLETE.md" \
"DSPy Training Ingestion Complete" "report" "active" "report, dspy, training"
migrate_file "$REPO_DOCS/FILE-ORGANIZATION-COMPLETE.md" \
"$OBSIDIAN_ROOT/docs/reports/FILE-ORGANIZATION-COMPLETE.md" \
"File Organization Complete" "report" "active" "report, organization"
migrate_file "$REPO_DOCS/MCP-INTEGRATION-COMPLETE.md" \
"$OBSIDIAN_ROOT/docs/reports/MCP-INTEGRATION-COMPLETE.md" \
"MCP Integration Complete" "report" "active" "report, mcp, integration"
migrate_file "$REPO_DOCS/TRAINING-DATA-INGESTION.md" \
"$OBSIDIAN_ROOT/docs/reports/TRAINING-DATA-INGESTION.md" \
"Training Data Ingestion" "report" "active" "report, training, ingestion"
migrate_file "$REPO_DOCS/STRUCTURELENSV2-FIX-REQUIRED.md" \
"$OBSIDIAN_ROOT/docs/reports/STRUCTURELENSV2-FIX-REQUIRED.md" \
"StructureLensV2 Fix Required" "report" "active" "report, lens, bug"
echo ""
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "Step 3: Active Plans → docs/plans/"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
migrate_file "$REPO_DOCS/AGENT-TRAINING-STATUS.md" \
"$OBSIDIAN_ROOT/docs/plans/AGENT-TRAINING-STATUS.md" \
"Agent Training Status" "plan" "active" "plan, training, agents"
migrate_file "$REPO_DOCS/INTEGRATION-STATUS.md" \
"$OBSIDIAN_ROOT/docs/plans/INTEGRATION-STATUS.md" \
"Integration Status" "plan" "active" "plan, integration"
migrate_file "$REPO_DOCS/MASTER-LEARNING-LOOP-PLAN-2025-10-17.md" \
"$OBSIDIAN_ROOT/docs/plans/MASTER-LEARNING-LOOP-PLAN.md" \
"Master Learning Loop Plan" "plan" "active" "plan, learning, automation"
migrate_file "$REPO_DOCS/MCP-AGENT-INTEGRATION-PLAN.md" \
"$OBSIDIAN_ROOT/docs/plans/MCP-AGENT-INTEGRATION-PLAN.md" \
"MCP Agent Integration Plan" "plan" "active" "plan, mcp, agents"
migrate_file "$REPO_DOCS/PRODUCTION-PLAN.md" \
"$OBSIDIAN_ROOT/docs/plans/PRODUCTION-PLAN.md" \
"Production Plan" "plan" "active" "plan, production"
echo ""
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "Step 4: Reference Guides → docs/reference/"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
migrate_file "$REPO_DOCS/DASHBOARD-GUIDE.md" \
"$OBSIDIAN_ROOT/docs/reference/DASHBOARD-GUIDE.md" \
"Dashboard Guide" "reference" "active" "reference, dashboard"
migrate_file "$REPO_DOCS/DASHBOARD.md" \
"$OBSIDIAN_ROOT/docs/reference/DASHBOARD.md" \
"Dashboard" "reference" "active" "reference, dashboard"
migrate_file "$REPO_DOCS/DRIVE-WEBHOOK-SETUP.md" \
"$OBSIDIAN_ROOT/docs/reference/DRIVE-WEBHOOK-SETUP.md" \
"Drive Webhook Setup" "reference" "active" "reference, drive, webhook"
migrate_file "$REPO_DOCS/DSPY-TRAINING-METHODOLOGY-EXPLAINED.md" \
"$OBSIDIAN_ROOT/docs/reference/DSPY-TRAINING-METHODOLOGY-EXPLAINED.md" \
"DSPy Training Methodology Explained" "reference" "active" "reference, dspy, training"
migrate_file "$REPO_DOCS/PRODUCTION-SETUP-AFS.md" \
"$OBSIDIAN_ROOT/docs/reference/PRODUCTION-SETUP-AFS.md" \
"Production Setup AFS" "reference" "active" "reference, production, afs"
migrate_file "$REPO_DOCS/QUERY-GUIDE.md" \
"$OBSIDIAN_ROOT/docs/reference/QUERY-GUIDE.md" \
"Query Guide" "reference" "active" "reference, query, agents"
migrate_file "$REPO_DOCS/QUICKSTART-TRAINING-DATA.md" \
"$OBSIDIAN_ROOT/docs/reference/QUICKSTART-TRAINING-DATA.md" \
"Quickstart Training Data" "reference" "active" "reference, training"
migrate_file "$REPO_DOCS/SELF-HOSTED-DEPLOYMENT-PLAN.md" \
"$OBSIDIAN_ROOT/docs/reference/SELF-HOSTED-DEPLOYMENT-PLAN.md" \
"Self Hosted Deployment Plan" "reference" "active" "reference, deployment"
migrate_file "$REPO_DOCS/Z840-DEPLOYMENT-CHECKLIST.md" \
"$OBSIDIAN_ROOT/docs/reference/Z840-DEPLOYMENT-CHECKLIST.md" \
"Z840 Deployment Checklist" "reference" "active" "reference, deployment, hardware"
echo ""
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "Step 5: System Concepts → docs/Memory/"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
migrate_file "$REPO_DOCS/AGENT-INPUT-PATTERNS.md" \
"$OBSIDIAN_ROOT/docs/Memory/AGENT-INPUT-PATTERNS.md" \
"Agent Input Patterns" "memory" "active" "memory, agents, patterns"
migrate_file "$REPO_DOCS/INFRANODUS-QUALITY-SCORE-ISSUE.md" \
"$OBSIDIAN_ROOT/docs/Memory/INFRANODUS-QUALITY-SCORE-ISSUE.md" \
"InfraNodus Quality Score Issue" "memory" "active" "memory, infranodus, issue"
migrate_file "$REPO_DOCS/README.md" \
"$OBSIDIAN_ROOT/docs/Memory/DOCS-README.md" \
"Docs README" "memory" "active" "memory, documentation"
echo ""
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo "✅ MIGRATION COMPLETE!"
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"
echo ""
echo "📊 Summary:"
echo " Files migrated: $total"
echo " Original files: KEPT in docs/"
echo " Frontmatter: ADDED to all files"
echo ""
echo "📂 Obsidian Locations:"
echo " archive/2025-10/ - Session summaries"
echo " docs/reports/ - Integration reports"
echo " docs/plans/ - Active plans"
echo " docs/reference/ - Reference guides"
echo " docs/Memory/ - System concepts"
echo ""
echo "Next steps:"
echo " 1. Open Obsidian vault"
echo " 2. Verify files are present with frontmatter"
echo " 3. Test links and structure"
echo " 4. Optional: Clean up repo docs/ folder"
echo ""
echo "━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━"