claude-flow-novice 2.18.21 → 2.18.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/cfn-scripts/check-memory.sh +150 -0
- package/.claude/cfn-scripts/run-with-memory-limit.sh +91 -0
- package/.claude/hooks/README.md +148 -148
- package/.claude/hooks/{SessionStart:cfn-load-openai-key.sh → SessionStart-cfn-load-openai-key.sh} +35 -35
- package/.claude/hooks/SessionStart:cfn-build-ruvector.sh +28 -28
- package/.claude/hooks/cfn-bash-search-hook.sh +87 -0
- package/.claude/hooks/cfn-smart-search-hook.sh +127 -0
- package/.claude/hooks/post-commit-codebase-index +79 -45
- package/.claude/settings.json +14 -3
- package/.claude/skills/cfn-edit-safety/lib/hooks/security-scanner.sh +1 -0
- package/.claude/skills/cfn-local-ruvector-accelerator/cfn-integration.sh +47 -6
- package/.claude/skills/cfn-local-ruvector-accelerator/src/cli/index.rs +6 -3
- package/.claude/skills/cfn-local-ruvector-accelerator/src/cli/init.rs +3 -3
- package/.claude/skills/cfn-local-ruvector-accelerator/src/cli/query.rs +1 -1
- package/.claude/skills/cfn-local-ruvector-accelerator/src/lib.rs +1 -0
- package/.claude/skills/cfn-local-ruvector-accelerator/src/paths.rs +4 -2
- package/.claude/skills/cfn-local-ruvector-accelerator/src/search_engine.rs +11 -0
- package/.claude/skills/cfn-local-ruvector-accelerator/test_query_api.sh +102 -102
- package/CLAUDE.md +32 -4
- package/package.json +9 -5
- package/scripts/organize-root-files.sh +340 -340
- package/scripts/postinstall.js +120 -3
- package/test-epic-creator-security.sh +202 -202
|
@@ -1,341 +1,341 @@
|
|
|
1
|
-
#!/bin/bash
|
|
2
|
-
# Root Directory File Organization Script
|
|
3
|
-
# This script organizes files in the root directory according to the plan in ROOT_FILE_ORGANIZATION_PLAN.md
|
|
4
|
-
|
|
5
|
-
set -euo pipefail
|
|
6
|
-
|
|
7
|
-
# Colors for output
|
|
8
|
-
RED='\033[0;31m'
|
|
9
|
-
GREEN='\033[0;32m'
|
|
10
|
-
YELLOW='\033[1;33m'
|
|
11
|
-
BLUE='\033[0;34m'
|
|
12
|
-
NC='\033[0m' # No Color
|
|
13
|
-
|
|
14
|
-
# Configuration
|
|
15
|
-
DRY_RUN=false
|
|
16
|
-
ROOT_DIR="/mnt/c/Users/masha/Documents/claude-flow-novice"
|
|
17
|
-
|
|
18
|
-
# Functions
|
|
19
|
-
log_info() {
|
|
20
|
-
echo -e "${BLUE}[INFO]${NC} $1"
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
log_success() {
|
|
24
|
-
echo -e "${GREEN}[SUCCESS]${NC} $1"
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
log_warning() {
|
|
28
|
-
echo -e "${YELLOW}[WARNING]${NC} $1"
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
log_error() {
|
|
32
|
-
echo -e "${RED}[ERROR]${NC} $1"
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
# Show help
|
|
36
|
-
show_help() {
|
|
37
|
-
cat << EOF
|
|
38
|
-
Root Directory File Organization Script
|
|
39
|
-
|
|
40
|
-
Usage: $0 [OPTIONS]
|
|
41
|
-
|
|
42
|
-
Options:
|
|
43
|
-
--dry-run Show what would be done without actually doing it
|
|
44
|
-
--help Show this help message
|
|
45
|
-
|
|
46
|
-
Description:
|
|
47
|
-
This script organizes files in the root directory according to the categories
|
|
48
|
-
defined in ROOT_FILE_ORGANIZATION_PLAN.md:
|
|
49
|
-
- DELETE: Phase/Sprint/Loop related files and duplicates
|
|
50
|
-
- KEEP: Essential project files (no action)
|
|
51
|
-
- MOVE: Move files to appropriate subdirectories
|
|
52
|
-
|
|
53
|
-
EOF
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
# Parse command line arguments
|
|
57
|
-
while [[ $# -gt 0 ]]; do
|
|
58
|
-
case $1 in
|
|
59
|
-
--dry-run)
|
|
60
|
-
DRY_RUN=true
|
|
61
|
-
shift
|
|
62
|
-
;;
|
|
63
|
-
--help)
|
|
64
|
-
show_help
|
|
65
|
-
exit 0
|
|
66
|
-
;;
|
|
67
|
-
*)
|
|
68
|
-
log_error "Unknown option: $1"
|
|
69
|
-
show_help
|
|
70
|
-
exit 1
|
|
71
|
-
;;
|
|
72
|
-
esac
|
|
73
|
-
done
|
|
74
|
-
|
|
75
|
-
# Change to root directory
|
|
76
|
-
cd "$ROOT_DIR" || {
|
|
77
|
-
log_error "Failed to change to root directory: $ROOT_DIR"
|
|
78
|
-
exit 1
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
# Create necessary directories
|
|
82
|
-
create_directories() {
|
|
83
|
-
local dirs=(
|
|
84
|
-
"docs/security/audits"
|
|
85
|
-
"docs/security/gnn"
|
|
86
|
-
"docs/reports"
|
|
87
|
-
"docs/ruvector"
|
|
88
|
-
"docs/testing"
|
|
89
|
-
"docs/reviews"
|
|
90
|
-
"docs/guides"
|
|
91
|
-
"scripts/utils"
|
|
92
|
-
"scripts/testing"
|
|
93
|
-
)
|
|
94
|
-
|
|
95
|
-
log_info "Creating necessary directories..."
|
|
96
|
-
|
|
97
|
-
for dir in "${dirs[@]}"; do
|
|
98
|
-
if [ ! -d "$dir" ]; then
|
|
99
|
-
if [ "$DRY_RUN" = true ]; then
|
|
100
|
-
log_info "Would create directory: $dir"
|
|
101
|
-
else
|
|
102
|
-
mkdir -p "$dir"
|
|
103
|
-
log_success "Created directory: $dir"
|
|
104
|
-
fi
|
|
105
|
-
else
|
|
106
|
-
log_info "Directory already exists: $dir"
|
|
107
|
-
fi
|
|
108
|
-
done
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
# Delete files marked for deletion
|
|
112
|
-
delete_files() {
|
|
113
|
-
log_info "Deleting files marked for deletion..."
|
|
114
|
-
|
|
115
|
-
# LOOP2 files
|
|
116
|
-
local loop2_files=(
|
|
117
|
-
"DEVOPS_VALIDATION_LOOP2.md"
|
|
118
|
-
"LOOP2_CODE_QUALITY_FEEDBACK.json"
|
|
119
|
-
"LOOP2_CODE_QUALITY_SUMMARY.txt"
|
|
120
|
-
"LOOP2_CODE_REVIEW_FEEDBACK.json"
|
|
121
|
-
"LOOP2_CODE_REVIEW_FEEDBACK_ITERATION2.json"
|
|
122
|
-
"LOOP2_CODE_REVIEW_SUMMARY.txt"
|
|
123
|
-
"LOOP2_VALIDATION_FINDINGS.json"
|
|
124
|
-
"LOOP2_VALIDATION_RESULTS.txt"
|
|
125
|
-
"LOOP2_VALIDATION_SUMMARY.json"
|
|
126
|
-
"SECURITY_VALIDATION_LOOP2_FINAL.json"
|
|
127
|
-
)
|
|
128
|
-
|
|
129
|
-
# PHASE files
|
|
130
|
-
local phase_files=(
|
|
131
|
-
"PHASE3_SPRINT31_FEEDBACK.json"
|
|
132
|
-
"SECURITY_AUDIT_PHASE3_SPRINT3.1_EXECUTIVE_SUMMARY.txt"
|
|
133
|
-
"SECURITY_AUDIT_PHASE3_SPRINT3.1_SUMMARY.json"
|
|
134
|
-
"VALIDATION_COMPLETE_ITERATION2.md"
|
|
135
|
-
"SECURITY_VALIDATION_FINAL_ITERATION2.json"
|
|
136
|
-
)
|
|
137
|
-
|
|
138
|
-
# Temporary and duplicate files
|
|
139
|
-
local temp_files=(
|
|
140
|
-
"claude-copy.md"
|
|
141
|
-
"ITERATION_2_RE_AUDIT_SUMMARY.txt"
|
|
142
|
-
"FINAL_TEST_SUCCESS.txt"
|
|
143
|
-
"full-test-output.txt"
|
|
144
|
-
"test-results.txt"
|
|
145
|
-
"VALIDATION_COMPLETION_REPORT.txt"
|
|
146
|
-
"ARCHITECTURE_REVIEW_COMPLETION.txt"
|
|
147
|
-
"IMPLEMENTATION_SUMMARY_THINKING_DECOMPOSER.md"
|
|
148
|
-
"TEST_FIX_SUMMARY.md"
|
|
149
|
-
"TYPE_SAFETY_REMEDIATION_PLAN.md"
|
|
150
|
-
)
|
|
151
|
-
|
|
152
|
-
# Combine all files to delete
|
|
153
|
-
local all_files=("${loop2_files[@]}" "${phase_files[@]}" "${temp_files[@]}")
|
|
154
|
-
|
|
155
|
-
for file in "${all_files[@]}"; do
|
|
156
|
-
if [ -f "$file" ]; then
|
|
157
|
-
if [ "$DRY_RUN" = true ]; then
|
|
158
|
-
log_info "Would delete: $file"
|
|
159
|
-
else
|
|
160
|
-
rm -f "$file"
|
|
161
|
-
log_success "Deleted: $file"
|
|
162
|
-
fi
|
|
163
|
-
else
|
|
164
|
-
log_warning "File not found, skipping: $file"
|
|
165
|
-
fi
|
|
166
|
-
done
|
|
167
|
-
}
|
|
168
|
-
|
|
169
|
-
# Move files to appropriate directories
|
|
170
|
-
move_files() {
|
|
171
|
-
log_info "Moving files to appropriate directories..."
|
|
172
|
-
|
|
173
|
-
# Architecture files → docs/architecture/
|
|
174
|
-
local architecture_moves=(
|
|
175
|
-
"ARCHITECTURE_CONFORMANCE_SUMMARY.txt:docs/architecture/"
|
|
176
|
-
"ARCHITECTURE_CONFORMANCE_VALIDATION.md:docs/architecture/"
|
|
177
|
-
"ARCHITECTURE_FOUNDATION_EXECUTIVE_SUMMARY.md:docs/architecture/"
|
|
178
|
-
"COORDINATOR_INTEGRATION_SUMMARY.md:docs/architecture/"
|
|
179
|
-
"MONITORING_AND_ALERTING_IMPLEMENTATION.md:docs/architecture/"
|
|
180
|
-
"OPERATIONS_QUICK_REFERENCE.md:docs/architecture/"
|
|
181
|
-
"TYPESCRIPT_VERIFICATION_INDEX.md:docs/architecture/"
|
|
182
|
-
)
|
|
183
|
-
|
|
184
|
-
# Security audit files → docs/security/audits/
|
|
185
|
-
local security_moves=(
|
|
186
|
-
"SECURITY_AUDIT_EXECUTIVE_SUMMARY.txt:docs/security/audits/"
|
|
187
|
-
"SECURITY_AUDIT_SUMMARY.json:docs/security/audits/"
|
|
188
|
-
"SECURITY_FINDINGS.json:docs/security/audits/"
|
|
189
|
-
"SECURITY_FINDINGS_STRUCTURED.json:docs/security/audits/"
|
|
190
|
-
"SECURITY_FIX_DELIVERY_SUMMARY.txt:docs/security/audits/"
|
|
191
|
-
"SECURITY_FIX_SEC-1.6_SUMMARY.txt:docs/security/audits/"
|
|
192
|
-
"SECURITY_FIX_sec-1.2_SUMMARY.txt:docs/security/audits/"
|
|
193
|
-
"SECURITY_ITERATION2_EXECUTIVE_SUMMARY.txt:docs/security/audits/"
|
|
194
|
-
"SECURITY_REVIEW_VALIDATION.txt:docs/security/audits/"
|
|
195
|
-
"SECURITY_VALIDATION_SUMMARY.json:docs/security/audits/"
|
|
196
|
-
"SECURITY_VALIDATION_SUMMARY.txt:docs/security/audits/"
|
|
197
|
-
"SEC_1_3_DELIVERABLES.md:docs/security/audits/"
|
|
198
|
-
"SEC_1_4_REMEDIATION_SUMMARY.md:docs/security/audits/"
|
|
199
|
-
"SEC_1_4_VULNERABILITY_ANALYSIS.md:docs/security/audits/"
|
|
200
|
-
"SEC_1_5_IMPLEMENTATION_GUIDE.md:docs/security/audits/"
|
|
201
|
-
"GNN_SECURITY_AUDIT_REPORT.md:docs/security/audits/"
|
|
202
|
-
"GNN_SECURITY_AUDIT_SUMMARY.json:docs/security/audits/"
|
|
203
|
-
"RUVECTOR_SECURITY_REMEDIATIONS.md:docs/security/audits/"
|
|
204
|
-
"TECHNICAL_DEBT_ASSESSMENT.json:docs/security/audits/"
|
|
205
|
-
)
|
|
206
|
-
|
|
207
|
-
# GNN files → docs/security/gnn/
|
|
208
|
-
local gnn_moves=(
|
|
209
|
-
"GNN_IMPLEMENTATION_SUMMARY.md:docs/security/gnn/"
|
|
210
|
-
"GNN_SECURITY_REMEDIATION_GUIDE.md:docs/security/gnn/"
|
|
211
|
-
"GNN_AUDIT_DELIVERY_INDEX.md:docs/security/gnn/"
|
|
212
|
-
)
|
|
213
|
-
|
|
214
|
-
# Implementation summaries → docs/reports/
|
|
215
|
-
local reports_moves=(
|
|
216
|
-
"DOCUMENTATION_DELIVERY_SUMMARY.md:docs/reports/"
|
|
217
|
-
"REDIS_KEY_FIX_REPORT.md:docs/reports/"
|
|
218
|
-
"RESEARCH_FINDINGS_EXECUTIVE_SUMMARY.md:docs/reports/"
|
|
219
|
-
"REVIEW_SUMMARY.md:docs/reports/"
|
|
220
|
-
"VALIDATION_REPORT_INDEX.md:docs/reports/"
|
|
221
|
-
"DEVOPS_VALIDATION_INDEX.md:docs/reports/"
|
|
222
|
-
"DRIVENDATA_COMPETITION_ANALYSIS.md:docs/reports/"
|
|
223
|
-
"SEO_MIGRATION_ANALYSIS.md:docs/reports/"
|
|
224
|
-
)
|
|
225
|
-
|
|
226
|
-
# RuVector files → docs/ or docs/ruvector/
|
|
227
|
-
local ruvector_moves=(
|
|
228
|
-
"RUVECTOR_DOCUMENTATION_COMPLETION_REPORT.md:docs/ruvector/"
|
|
229
|
-
"IMPLEMENTATION_SUMMARY_RUVECTOR_TESTS.md:docs/testing/"
|
|
230
|
-
)
|
|
231
|
-
|
|
232
|
-
# Testing files → docs/testing/
|
|
233
|
-
local testing_moves=(
|
|
234
|
-
"TESTING_GUIDE.md:docs/testing/"
|
|
235
|
-
"README-Rust-Fixer.md:docs/testing/"
|
|
236
|
-
)
|
|
237
|
-
|
|
238
|
-
# Code review feedback → docs/reviews/
|
|
239
|
-
local reviews_moves=(
|
|
240
|
-
"CODE_REVIEW_ITERATION_2_FEEDBACK.json:docs/reviews/"
|
|
241
|
-
"CODE_REVIEW_PHASE_5_FEEDBACK.json:docs/reviews/"
|
|
242
|
-
"REVIEW_FEEDBACK.json:docs/reviews/"
|
|
243
|
-
"CODE_REVIEW_SANITIZE_INPUT_FEEDBACK.json:docs/reviews/"
|
|
244
|
-
)
|
|
245
|
-
|
|
246
|
-
# Documentation and guides → docs/guides/
|
|
247
|
-
local guides_moves=(
|
|
248
|
-
"README_TRIGGER_DEV_V4_DOCUMENTATION.md:docs/guides/"
|
|
249
|
-
)
|
|
250
|
-
|
|
251
|
-
# Shell scripts → scripts/
|
|
252
|
-
local script_moves=(
|
|
253
|
-
"dump_current_files.sh:scripts/utils/"
|
|
254
|
-
"examine-implementation.sh:scripts/utils/"
|
|
255
|
-
"get-docs.sh:scripts/utils/"
|
|
256
|
-
"get_git_content.sh:scripts/utils/"
|
|
257
|
-
"read-files.sh:scripts/utils/"
|
|
258
|
-
"search-ruvector.sh:scripts/utils/"
|
|
259
|
-
"test-read.sh:scripts/utils/"
|
|
260
|
-
"validate-docs.sh:scripts/utils/"
|
|
261
|
-
"verify_files.sh:scripts/utils/"
|
|
262
|
-
"test-rust-fixer-integration.sh:scripts/testing/"
|
|
263
|
-
"test-rust-fixer-validation.sh:scripts/testing/"
|
|
264
|
-
)
|
|
265
|
-
|
|
266
|
-
# Combine all move arrays
|
|
267
|
-
local all_moves=(
|
|
268
|
-
"${architecture_moves[@]}"
|
|
269
|
-
"${security_moves[@]}"
|
|
270
|
-
"${gnn_moves[@]}"
|
|
271
|
-
"${reports_moves[@]}"
|
|
272
|
-
"${ruvector_moves[@]}"
|
|
273
|
-
"${testing_moves[@]}"
|
|
274
|
-
"${reviews_moves[@]}"
|
|
275
|
-
"${guides_moves[@]}"
|
|
276
|
-
"${script_moves[@]}"
|
|
277
|
-
)
|
|
278
|
-
|
|
279
|
-
# Process moves
|
|
280
|
-
for move in "${all_moves[@]}"; do
|
|
281
|
-
local file="${move%%:*}"
|
|
282
|
-
local dest="${move##*:}"
|
|
283
|
-
|
|
284
|
-
if [ -f "$file" ]; then
|
|
285
|
-
if [ "$DRY_RUN" = true ]; then
|
|
286
|
-
log_info "Would move: $file → $dest"
|
|
287
|
-
else
|
|
288
|
-
# Check if destination file already exists
|
|
289
|
-
if [ -f "$dest/$file" ]; then
|
|
290
|
-
log_warning "Destination file exists, skipping: $dest/$file"
|
|
291
|
-
continue
|
|
292
|
-
fi
|
|
293
|
-
|
|
294
|
-
mv "$file" "$dest"
|
|
295
|
-
log_success "Moved: $file → $dest"
|
|
296
|
-
fi
|
|
297
|
-
else
|
|
298
|
-
log_warning "File not found, skipping: $file"
|
|
299
|
-
fi
|
|
300
|
-
done
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
# Main execution
|
|
304
|
-
main() {
|
|
305
|
-
log_info "Starting root directory file organization..."
|
|
306
|
-
log_info "Mode: $([ "$DRY_RUN" = true ] && echo "DRY RUN" || echo "EXECUTE")"
|
|
307
|
-
|
|
308
|
-
# Step 1: Create directories
|
|
309
|
-
create_directories
|
|
310
|
-
|
|
311
|
-
# Step 2: Delete files
|
|
312
|
-
if [ "$DRY_RUN" = false ]; then
|
|
313
|
-
read -p "Continue with deleting files? (y/N) " -n 1 -r
|
|
314
|
-
echo
|
|
315
|
-
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
|
|
316
|
-
log_info "Skipping file deletion"
|
|
317
|
-
else
|
|
318
|
-
delete_files
|
|
319
|
-
fi
|
|
320
|
-
else
|
|
321
|
-
delete_files
|
|
322
|
-
fi
|
|
323
|
-
|
|
324
|
-
# Step 3: Move files
|
|
325
|
-
if [ "$DRY_RUN" = false ]; then
|
|
326
|
-
read -p "Continue with moving files? (y/N) " -n 1 -r
|
|
327
|
-
echo
|
|
328
|
-
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
|
|
329
|
-
log_info "Skipping file moves"
|
|
330
|
-
else
|
|
331
|
-
move_files
|
|
332
|
-
fi
|
|
333
|
-
else
|
|
334
|
-
move_files
|
|
335
|
-
fi
|
|
336
|
-
|
|
337
|
-
log_success "File organization complete!"
|
|
338
|
-
}
|
|
339
|
-
|
|
340
|
-
# Run main function
|
|
1
|
+
#!/bin/bash
|
|
2
|
+
# Root Directory File Organization Script
|
|
3
|
+
# This script organizes files in the root directory according to the plan in ROOT_FILE_ORGANIZATION_PLAN.md
|
|
4
|
+
|
|
5
|
+
set -euo pipefail
|
|
6
|
+
|
|
7
|
+
# Colors for output
|
|
8
|
+
RED='\033[0;31m'
|
|
9
|
+
GREEN='\033[0;32m'
|
|
10
|
+
YELLOW='\033[1;33m'
|
|
11
|
+
BLUE='\033[0;34m'
|
|
12
|
+
NC='\033[0m' # No Color
|
|
13
|
+
|
|
14
|
+
# Configuration
|
|
15
|
+
DRY_RUN=false
|
|
16
|
+
ROOT_DIR="/mnt/c/Users/masha/Documents/claude-flow-novice"
|
|
17
|
+
|
|
18
|
+
# Functions
|
|
19
|
+
log_info() {
|
|
20
|
+
echo -e "${BLUE}[INFO]${NC} $1"
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
log_success() {
|
|
24
|
+
echo -e "${GREEN}[SUCCESS]${NC} $1"
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
log_warning() {
|
|
28
|
+
echo -e "${YELLOW}[WARNING]${NC} $1"
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
log_error() {
|
|
32
|
+
echo -e "${RED}[ERROR]${NC} $1"
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
# Show help
|
|
36
|
+
show_help() {
|
|
37
|
+
cat << EOF
|
|
38
|
+
Root Directory File Organization Script
|
|
39
|
+
|
|
40
|
+
Usage: $0 [OPTIONS]
|
|
41
|
+
|
|
42
|
+
Options:
|
|
43
|
+
--dry-run Show what would be done without actually doing it
|
|
44
|
+
--help Show this help message
|
|
45
|
+
|
|
46
|
+
Description:
|
|
47
|
+
This script organizes files in the root directory according to the categories
|
|
48
|
+
defined in ROOT_FILE_ORGANIZATION_PLAN.md:
|
|
49
|
+
- DELETE: Phase/Sprint/Loop related files and duplicates
|
|
50
|
+
- KEEP: Essential project files (no action)
|
|
51
|
+
- MOVE: Move files to appropriate subdirectories
|
|
52
|
+
|
|
53
|
+
EOF
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
# Parse command line arguments
|
|
57
|
+
while [[ $# -gt 0 ]]; do
|
|
58
|
+
case $1 in
|
|
59
|
+
--dry-run)
|
|
60
|
+
DRY_RUN=true
|
|
61
|
+
shift
|
|
62
|
+
;;
|
|
63
|
+
--help)
|
|
64
|
+
show_help
|
|
65
|
+
exit 0
|
|
66
|
+
;;
|
|
67
|
+
*)
|
|
68
|
+
log_error "Unknown option: $1"
|
|
69
|
+
show_help
|
|
70
|
+
exit 1
|
|
71
|
+
;;
|
|
72
|
+
esac
|
|
73
|
+
done
|
|
74
|
+
|
|
75
|
+
# Change to root directory
|
|
76
|
+
cd "$ROOT_DIR" || {
|
|
77
|
+
log_error "Failed to change to root directory: $ROOT_DIR"
|
|
78
|
+
exit 1
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
# Create necessary directories
|
|
82
|
+
create_directories() {
|
|
83
|
+
local dirs=(
|
|
84
|
+
"docs/security/audits"
|
|
85
|
+
"docs/security/gnn"
|
|
86
|
+
"docs/reports"
|
|
87
|
+
"docs/ruvector"
|
|
88
|
+
"docs/testing"
|
|
89
|
+
"docs/reviews"
|
|
90
|
+
"docs/guides"
|
|
91
|
+
"scripts/utils"
|
|
92
|
+
"scripts/testing"
|
|
93
|
+
)
|
|
94
|
+
|
|
95
|
+
log_info "Creating necessary directories..."
|
|
96
|
+
|
|
97
|
+
for dir in "${dirs[@]}"; do
|
|
98
|
+
if [ ! -d "$dir" ]; then
|
|
99
|
+
if [ "$DRY_RUN" = true ]; then
|
|
100
|
+
log_info "Would create directory: $dir"
|
|
101
|
+
else
|
|
102
|
+
mkdir -p "$dir"
|
|
103
|
+
log_success "Created directory: $dir"
|
|
104
|
+
fi
|
|
105
|
+
else
|
|
106
|
+
log_info "Directory already exists: $dir"
|
|
107
|
+
fi
|
|
108
|
+
done
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
# Delete files marked for deletion
|
|
112
|
+
delete_files() {
|
|
113
|
+
log_info "Deleting files marked for deletion..."
|
|
114
|
+
|
|
115
|
+
# LOOP2 files
|
|
116
|
+
local loop2_files=(
|
|
117
|
+
"DEVOPS_VALIDATION_LOOP2.md"
|
|
118
|
+
"LOOP2_CODE_QUALITY_FEEDBACK.json"
|
|
119
|
+
"LOOP2_CODE_QUALITY_SUMMARY.txt"
|
|
120
|
+
"LOOP2_CODE_REVIEW_FEEDBACK.json"
|
|
121
|
+
"LOOP2_CODE_REVIEW_FEEDBACK_ITERATION2.json"
|
|
122
|
+
"LOOP2_CODE_REVIEW_SUMMARY.txt"
|
|
123
|
+
"LOOP2_VALIDATION_FINDINGS.json"
|
|
124
|
+
"LOOP2_VALIDATION_RESULTS.txt"
|
|
125
|
+
"LOOP2_VALIDATION_SUMMARY.json"
|
|
126
|
+
"SECURITY_VALIDATION_LOOP2_FINAL.json"
|
|
127
|
+
)
|
|
128
|
+
|
|
129
|
+
# PHASE files
|
|
130
|
+
local phase_files=(
|
|
131
|
+
"PHASE3_SPRINT31_FEEDBACK.json"
|
|
132
|
+
"SECURITY_AUDIT_PHASE3_SPRINT3.1_EXECUTIVE_SUMMARY.txt"
|
|
133
|
+
"SECURITY_AUDIT_PHASE3_SPRINT3.1_SUMMARY.json"
|
|
134
|
+
"VALIDATION_COMPLETE_ITERATION2.md"
|
|
135
|
+
"SECURITY_VALIDATION_FINAL_ITERATION2.json"
|
|
136
|
+
)
|
|
137
|
+
|
|
138
|
+
# Temporary and duplicate files
|
|
139
|
+
local temp_files=(
|
|
140
|
+
"claude-copy.md"
|
|
141
|
+
"ITERATION_2_RE_AUDIT_SUMMARY.txt"
|
|
142
|
+
"FINAL_TEST_SUCCESS.txt"
|
|
143
|
+
"full-test-output.txt"
|
|
144
|
+
"test-results.txt"
|
|
145
|
+
"VALIDATION_COMPLETION_REPORT.txt"
|
|
146
|
+
"ARCHITECTURE_REVIEW_COMPLETION.txt"
|
|
147
|
+
"IMPLEMENTATION_SUMMARY_THINKING_DECOMPOSER.md"
|
|
148
|
+
"TEST_FIX_SUMMARY.md"
|
|
149
|
+
"TYPE_SAFETY_REMEDIATION_PLAN.md"
|
|
150
|
+
)
|
|
151
|
+
|
|
152
|
+
# Combine all files to delete
|
|
153
|
+
local all_files=("${loop2_files[@]}" "${phase_files[@]}" "${temp_files[@]}")
|
|
154
|
+
|
|
155
|
+
for file in "${all_files[@]}"; do
|
|
156
|
+
if [ -f "$file" ]; then
|
|
157
|
+
if [ "$DRY_RUN" = true ]; then
|
|
158
|
+
log_info "Would delete: $file"
|
|
159
|
+
else
|
|
160
|
+
rm -f "$file"
|
|
161
|
+
log_success "Deleted: $file"
|
|
162
|
+
fi
|
|
163
|
+
else
|
|
164
|
+
log_warning "File not found, skipping: $file"
|
|
165
|
+
fi
|
|
166
|
+
done
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
# Move files to appropriate directories
|
|
170
|
+
move_files() {
|
|
171
|
+
log_info "Moving files to appropriate directories..."
|
|
172
|
+
|
|
173
|
+
# Architecture files → docs/architecture/
|
|
174
|
+
local architecture_moves=(
|
|
175
|
+
"ARCHITECTURE_CONFORMANCE_SUMMARY.txt:docs/architecture/"
|
|
176
|
+
"ARCHITECTURE_CONFORMANCE_VALIDATION.md:docs/architecture/"
|
|
177
|
+
"ARCHITECTURE_FOUNDATION_EXECUTIVE_SUMMARY.md:docs/architecture/"
|
|
178
|
+
"COORDINATOR_INTEGRATION_SUMMARY.md:docs/architecture/"
|
|
179
|
+
"MONITORING_AND_ALERTING_IMPLEMENTATION.md:docs/architecture/"
|
|
180
|
+
"OPERATIONS_QUICK_REFERENCE.md:docs/architecture/"
|
|
181
|
+
"TYPESCRIPT_VERIFICATION_INDEX.md:docs/architecture/"
|
|
182
|
+
)
|
|
183
|
+
|
|
184
|
+
# Security audit files → docs/security/audits/
|
|
185
|
+
local security_moves=(
|
|
186
|
+
"SECURITY_AUDIT_EXECUTIVE_SUMMARY.txt:docs/security/audits/"
|
|
187
|
+
"SECURITY_AUDIT_SUMMARY.json:docs/security/audits/"
|
|
188
|
+
"SECURITY_FINDINGS.json:docs/security/audits/"
|
|
189
|
+
"SECURITY_FINDINGS_STRUCTURED.json:docs/security/audits/"
|
|
190
|
+
"SECURITY_FIX_DELIVERY_SUMMARY.txt:docs/security/audits/"
|
|
191
|
+
"SECURITY_FIX_SEC-1.6_SUMMARY.txt:docs/security/audits/"
|
|
192
|
+
"SECURITY_FIX_sec-1.2_SUMMARY.txt:docs/security/audits/"
|
|
193
|
+
"SECURITY_ITERATION2_EXECUTIVE_SUMMARY.txt:docs/security/audits/"
|
|
194
|
+
"SECURITY_REVIEW_VALIDATION.txt:docs/security/audits/"
|
|
195
|
+
"SECURITY_VALIDATION_SUMMARY.json:docs/security/audits/"
|
|
196
|
+
"SECURITY_VALIDATION_SUMMARY.txt:docs/security/audits/"
|
|
197
|
+
"SEC_1_3_DELIVERABLES.md:docs/security/audits/"
|
|
198
|
+
"SEC_1_4_REMEDIATION_SUMMARY.md:docs/security/audits/"
|
|
199
|
+
"SEC_1_4_VULNERABILITY_ANALYSIS.md:docs/security/audits/"
|
|
200
|
+
"SEC_1_5_IMPLEMENTATION_GUIDE.md:docs/security/audits/"
|
|
201
|
+
"GNN_SECURITY_AUDIT_REPORT.md:docs/security/audits/"
|
|
202
|
+
"GNN_SECURITY_AUDIT_SUMMARY.json:docs/security/audits/"
|
|
203
|
+
"RUVECTOR_SECURITY_REMEDIATIONS.md:docs/security/audits/"
|
|
204
|
+
"TECHNICAL_DEBT_ASSESSMENT.json:docs/security/audits/"
|
|
205
|
+
)
|
|
206
|
+
|
|
207
|
+
# GNN files → docs/security/gnn/
|
|
208
|
+
local gnn_moves=(
|
|
209
|
+
"GNN_IMPLEMENTATION_SUMMARY.md:docs/security/gnn/"
|
|
210
|
+
"GNN_SECURITY_REMEDIATION_GUIDE.md:docs/security/gnn/"
|
|
211
|
+
"GNN_AUDIT_DELIVERY_INDEX.md:docs/security/gnn/"
|
|
212
|
+
)
|
|
213
|
+
|
|
214
|
+
# Implementation summaries → docs/reports/
|
|
215
|
+
local reports_moves=(
|
|
216
|
+
"DOCUMENTATION_DELIVERY_SUMMARY.md:docs/reports/"
|
|
217
|
+
"REDIS_KEY_FIX_REPORT.md:docs/reports/"
|
|
218
|
+
"RESEARCH_FINDINGS_EXECUTIVE_SUMMARY.md:docs/reports/"
|
|
219
|
+
"REVIEW_SUMMARY.md:docs/reports/"
|
|
220
|
+
"VALIDATION_REPORT_INDEX.md:docs/reports/"
|
|
221
|
+
"DEVOPS_VALIDATION_INDEX.md:docs/reports/"
|
|
222
|
+
"DRIVENDATA_COMPETITION_ANALYSIS.md:docs/reports/"
|
|
223
|
+
"SEO_MIGRATION_ANALYSIS.md:docs/reports/"
|
|
224
|
+
)
|
|
225
|
+
|
|
226
|
+
# RuVector files → docs/ or docs/ruvector/
|
|
227
|
+
local ruvector_moves=(
|
|
228
|
+
"RUVECTOR_DOCUMENTATION_COMPLETION_REPORT.md:docs/ruvector/"
|
|
229
|
+
"IMPLEMENTATION_SUMMARY_RUVECTOR_TESTS.md:docs/testing/"
|
|
230
|
+
)
|
|
231
|
+
|
|
232
|
+
# Testing files → docs/testing/
|
|
233
|
+
local testing_moves=(
|
|
234
|
+
"TESTING_GUIDE.md:docs/testing/"
|
|
235
|
+
"README-Rust-Fixer.md:docs/testing/"
|
|
236
|
+
)
|
|
237
|
+
|
|
238
|
+
# Code review feedback → docs/reviews/
|
|
239
|
+
local reviews_moves=(
|
|
240
|
+
"CODE_REVIEW_ITERATION_2_FEEDBACK.json:docs/reviews/"
|
|
241
|
+
"CODE_REVIEW_PHASE_5_FEEDBACK.json:docs/reviews/"
|
|
242
|
+
"REVIEW_FEEDBACK.json:docs/reviews/"
|
|
243
|
+
"CODE_REVIEW_SANITIZE_INPUT_FEEDBACK.json:docs/reviews/"
|
|
244
|
+
)
|
|
245
|
+
|
|
246
|
+
# Documentation and guides → docs/guides/
|
|
247
|
+
local guides_moves=(
|
|
248
|
+
"README_TRIGGER_DEV_V4_DOCUMENTATION.md:docs/guides/"
|
|
249
|
+
)
|
|
250
|
+
|
|
251
|
+
# Shell scripts → scripts/
|
|
252
|
+
local script_moves=(
|
|
253
|
+
"dump_current_files.sh:scripts/utils/"
|
|
254
|
+
"examine-implementation.sh:scripts/utils/"
|
|
255
|
+
"get-docs.sh:scripts/utils/"
|
|
256
|
+
"get_git_content.sh:scripts/utils/"
|
|
257
|
+
"read-files.sh:scripts/utils/"
|
|
258
|
+
"search-ruvector.sh:scripts/utils/"
|
|
259
|
+
"test-read.sh:scripts/utils/"
|
|
260
|
+
"validate-docs.sh:scripts/utils/"
|
|
261
|
+
"verify_files.sh:scripts/utils/"
|
|
262
|
+
"test-rust-fixer-integration.sh:scripts/testing/"
|
|
263
|
+
"test-rust-fixer-validation.sh:scripts/testing/"
|
|
264
|
+
)
|
|
265
|
+
|
|
266
|
+
# Combine all move arrays
|
|
267
|
+
local all_moves=(
|
|
268
|
+
"${architecture_moves[@]}"
|
|
269
|
+
"${security_moves[@]}"
|
|
270
|
+
"${gnn_moves[@]}"
|
|
271
|
+
"${reports_moves[@]}"
|
|
272
|
+
"${ruvector_moves[@]}"
|
|
273
|
+
"${testing_moves[@]}"
|
|
274
|
+
"${reviews_moves[@]}"
|
|
275
|
+
"${guides_moves[@]}"
|
|
276
|
+
"${script_moves[@]}"
|
|
277
|
+
)
|
|
278
|
+
|
|
279
|
+
# Process moves
|
|
280
|
+
for move in "${all_moves[@]}"; do
|
|
281
|
+
local file="${move%%:*}"
|
|
282
|
+
local dest="${move##*:}"
|
|
283
|
+
|
|
284
|
+
if [ -f "$file" ]; then
|
|
285
|
+
if [ "$DRY_RUN" = true ]; then
|
|
286
|
+
log_info "Would move: $file → $dest"
|
|
287
|
+
else
|
|
288
|
+
# Check if destination file already exists
|
|
289
|
+
if [ -f "$dest/$file" ]; then
|
|
290
|
+
log_warning "Destination file exists, skipping: $dest/$file"
|
|
291
|
+
continue
|
|
292
|
+
fi
|
|
293
|
+
|
|
294
|
+
mv "$file" "$dest"
|
|
295
|
+
log_success "Moved: $file → $dest"
|
|
296
|
+
fi
|
|
297
|
+
else
|
|
298
|
+
log_warning "File not found, skipping: $file"
|
|
299
|
+
fi
|
|
300
|
+
done
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
# Main execution
|
|
304
|
+
main() {
|
|
305
|
+
log_info "Starting root directory file organization..."
|
|
306
|
+
log_info "Mode: $([ "$DRY_RUN" = true ] && echo "DRY RUN" || echo "EXECUTE")"
|
|
307
|
+
|
|
308
|
+
# Step 1: Create directories
|
|
309
|
+
create_directories
|
|
310
|
+
|
|
311
|
+
# Step 2: Delete files
|
|
312
|
+
if [ "$DRY_RUN" = false ]; then
|
|
313
|
+
read -p "Continue with deleting files? (y/N) " -n 1 -r
|
|
314
|
+
echo
|
|
315
|
+
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
|
|
316
|
+
log_info "Skipping file deletion"
|
|
317
|
+
else
|
|
318
|
+
delete_files
|
|
319
|
+
fi
|
|
320
|
+
else
|
|
321
|
+
delete_files
|
|
322
|
+
fi
|
|
323
|
+
|
|
324
|
+
# Step 3: Move files
|
|
325
|
+
if [ "$DRY_RUN" = false ]; then
|
|
326
|
+
read -p "Continue with moving files? (y/N) " -n 1 -r
|
|
327
|
+
echo
|
|
328
|
+
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
|
|
329
|
+
log_info "Skipping file moves"
|
|
330
|
+
else
|
|
331
|
+
move_files
|
|
332
|
+
fi
|
|
333
|
+
else
|
|
334
|
+
move_files
|
|
335
|
+
fi
|
|
336
|
+
|
|
337
|
+
log_success "File organization complete!"
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
# Run main function
|
|
341
341
|
main "$@"
|