-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathproject-status.ps1
More file actions
179 lines (155 loc) · 5.27 KB
/
project-status.ps1
File metadata and controls
179 lines (155 loc) · 5.27 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
# project-status.ps1
# Clean PowerShell script for project status with memory system support
# Adapted for Books of Ukraine project context
param(
[switch]$Detailed,
[switch]$MemoryCheck
)
Write-Host "BOOKS OF UKRAINE PROJECT STATUS CHECK" -ForegroundColor Magenta
Write-Host "=====================================" -ForegroundColor Magenta
# 1. Check project structure
Write-Host ""
Write-Host "Step 1: Project Structure" -ForegroundColor Cyan
$criticalPaths = @(
"ai/mission.md",
"ai/glossary.md",
"ai/memory-human.md",
"data-public",
"data-private",
"analysis",
"manipulation/0-ellis.R",
"config.yml",
"books-of-ukraine.Rproj"
)
foreach ($path in $criticalPaths) {
if (Test-Path $path) {
Write-Host "OK $path" -ForegroundColor Green
} else {
Write-Host "MISSING $path" -ForegroundColor Red
}
}
# 2. Data availability checks
Write-Host ""
Write-Host "Step 2: Data Availability" -ForegroundColor Cyan
# Check data directories
$dataPaths = @(
"data-private",
"data-public"
)
foreach ($path in $dataPaths) {
if (Test-Path $path) {
Write-Host "OK $path" -ForegroundColor Green
} else {
Write-Host "MISSING $path" -ForegroundColor Red
}
}
# Check for any existing data files
if (Test-Path "data-private/*") {
$dataCount = (Get-ChildItem -Path "data-private" -Recurse -File).Count
Write-Host "OK data-private contains $dataCount files" -ForegroundColor Green
} else {
Write-Host "WARNING: data-private appears empty" -ForegroundColor Yellow
}
# Check for database files
Write-Host ""
Write-Host "Available Databases:" -ForegroundColor Yellow
$databases = @(
"data-private/derived/manipulation/SQLite/books-of-ukraine.sqlite",
"data-private/derived/manipulation/SQLite/books-of-ukraine-2.sqlite"
)
$dbNames = @("Main (analysis-ready)", "Stage 2 (books + admin + extra)")
for ($i = 0; $i -lt $databases.Length; $i++) {
$db = $databases[$i]
$name = $dbNames[$i]
if (Test-Path $db) {
$size = [math]::Round((Get-Item $db).Length / 1MB, 2)
Write-Host "OK $name ($size MB)" -ForegroundColor Green
} else {
Write-Host "MISSING $name" -ForegroundColor Red
}
}
# 3. Git status
Write-Host ""
Write-Host "Step 3: Git Status" -ForegroundColor Cyan
try {
$gitBranch = git branch --show-current 2>$null
$gitStatus = git status --porcelain 2>$null
if ($gitBranch) {
Write-Host "Current branch: $gitBranch" -ForegroundColor Green
if ($gitStatus) {
Write-Host "WARNING: Uncommitted changes detected" -ForegroundColor Yellow
} else {
Write-Host "Working directory clean" -ForegroundColor Green
}
} else {
Write-Host "Not a git repository or git not available" -ForegroundColor Red
}
} catch {
Write-Host "Git status check failed" -ForegroundColor Red
}
# 4. Workspace validation
Write-Host ""
Write-Host "Step 4: Workspace Configuration" -ForegroundColor Cyan
$workspaceFiles = Get-ChildItem -Name "*.code-workspace"
if ($workspaceFiles) {
Write-Host "Workspace file detected: $($workspaceFiles -join ', ')" -ForegroundColor Green
} else {
Write-Host "WARNING: Workspace file not found" -ForegroundColor Yellow
}
# Check R project file
if (Test-Path "books-of-ukraine.Rproj") {
Write-Host "OK R Project file found" -ForegroundColor Green
} else {
Write-Host "WARNING: R Project file missing" -ForegroundColor Yellow
}
# 5. Project memory
Write-Host ""
Write-Host "Step 5: Project Memory System" -ForegroundColor Cyan
$memoryFiles = @(
"ai/memory-ai.md",
"ai/memory-human.md",
"ai/memory-hub.md",
"ai/memory-guide.md"
)
$foundMemoryFiles = @()
foreach ($memFile in $memoryFiles) {
if (Test-Path $memFile) {
$foundMemoryFiles += $memFile
}
}
if ($foundMemoryFiles.Count -gt 0) {
Write-Host "Multi-file memory system active" -ForegroundColor Green
Write-Host "Memory files found: $($foundMemoryFiles.Count)/$($memoryFiles.Count)" -ForegroundColor Gray
foreach ($file in $foundMemoryFiles) {
$fileName = Split-Path $file -Leaf
Write-Host " $fileName" -ForegroundColor Green
}
} else {
Write-Host "WARNING: No memory files found" -ForegroundColor Yellow
}
Write-Host ""
Write-Host "AIM 2025 SANDBOX PROJECT STATUS CHECK COMPLETE" -ForegroundColor Magenta
# Optional detailed output
if ($Detailed) {
Write-Host ""
Write-Host "=== DETAILED PROJECT INFORMATION ===" -ForegroundColor Cyan
# Analysis directories
if (Test-Path "analysis") {
$analysisDir = Get-ChildItem "analysis" -Directory
Write-Host "Analysis directories: $($analysisDir.Count)" -ForegroundColor Gray
foreach ($dir in $analysisDir) {
Write-Host " - $($dir.Name)" -ForegroundColor Gray
}
}
# Recent log files
if (Test-Path "ai/log") {
$logFiles = Get-ChildItem "ai/log" -Filter "*.md" | Sort-Object LastWriteTime -Descending | Select-Object -First 3
if ($logFiles.Count -gt 0) {
Write-Host "Recent log files:" -ForegroundColor Gray
foreach ($log in $logFiles) {
$age = [math]::Round(((Get-Date) - $log.LastWriteTime).TotalHours, 1)
Write-Host " - $($log.Name) ($age hrs old)" -ForegroundColor Gray
}
}
}
}