pumuki-ast-hooks 5.5.50 → 5.5.51
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/package.json +1 -1
- package/scripts/hooks-system/.audit_tmp/hook-metrics.jsonl +48 -0
- package/scripts/hooks-system/application/services/installation/HookAssetsInstaller.js +0 -0
- package/scripts/hooks-system/application/services/installation/McpConfigurator.js +84 -18
- package/scripts/hooks-system/application/services/monitoring/EvidenceMonitor.js +5 -146
- package/scripts/hooks-system/application/services/monitoring/EvidenceRefreshRunner.js +161 -0
- package/scripts/hooks-system/infrastructure/ast/ios/analyzers/StagedSwiftFilePreparer.js +59 -0
- package/scripts/hooks-system/infrastructure/ast/ios/analyzers/SwiftAstRunner.js +51 -0
- package/scripts/hooks-system/infrastructure/ast/ios/analyzers/SwiftToolchainResolver.js +57 -0
- package/scripts/hooks-system/infrastructure/ast/ios/analyzers/iOSASTIntelligentAnalyzer.js +27 -137
- package/scripts/hooks-system/infrastructure/ast/ios/analyzers/iOSAstAnalysisOrchestrator.js +32 -0
- package/scripts/hooks-system/infrastructure/mcp/ast-intelligence-automation.js +407 -5
- package/scripts/hooks-system/infrastructure/shell/gitflow/gitflow-enforcer.sh +21 -67
|
@@ -25,7 +25,6 @@ AUTO_MERGE_PR=${GITFLOW_AUTO_MERGE:-false}
|
|
|
25
25
|
PR_BASE_BRANCH=${GITFLOW_PR_BASE:-develop}
|
|
26
26
|
STRICT_ATOMIC=${GITFLOW_STRICT_ATOMIC:-true}
|
|
27
27
|
REQUIRE_TEST_RELATIONS=${GITFLOW_REQUIRE_TESTS:-true}
|
|
28
|
-
STRICT_CHECK=${GITFLOW_STRICT_CHECK:-false}
|
|
29
28
|
|
|
30
29
|
print_section() {
|
|
31
30
|
printf "${BLUE}═══════════════════════════════════════════════════════════════${NC}\n"
|
|
@@ -168,17 +167,16 @@ verify_atomic_commit() {
|
|
|
168
167
|
return 0
|
|
169
168
|
fi
|
|
170
169
|
|
|
171
|
-
local files=()
|
|
170
|
+
local -a files=()
|
|
172
171
|
while IFS= read -r file; do
|
|
173
|
-
[[ -
|
|
174
|
-
files+=("$file")
|
|
172
|
+
[[ -n "$file" ]] && files+=("$file")
|
|
175
173
|
done < <($GIT_BIN diff --name-only "${commit}^..${commit}")
|
|
176
174
|
if [[ "${#files[@]}" -eq 0 ]]; then
|
|
177
175
|
return 0
|
|
178
176
|
fi
|
|
179
177
|
|
|
180
|
-
local roots_list
|
|
181
|
-
|
|
178
|
+
local roots_list=""
|
|
179
|
+
local root_count=0
|
|
182
180
|
for file in "${files[@]}"; do
|
|
183
181
|
local root="${file%%/*}"
|
|
184
182
|
if [[ "$root" == "$file" ]]; then
|
|
@@ -193,36 +191,24 @@ verify_atomic_commit() {
|
|
|
193
191
|
;;
|
|
194
192
|
esac
|
|
195
193
|
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
for existing in "${roots_list[@]}"; do
|
|
200
|
-
if [[ "$existing" == "$root" ]]; then
|
|
201
|
-
seen=1
|
|
202
|
-
break
|
|
203
|
-
fi
|
|
204
|
-
done
|
|
205
|
-
fi
|
|
206
|
-
if [[ "$seen" -eq 0 ]]; then
|
|
207
|
-
roots_list+=("$root")
|
|
194
|
+
if [[ " $roots_list " != *" $root "* ]]; then
|
|
195
|
+
roots_list="${roots_list}${root} "
|
|
196
|
+
root_count=$((root_count + 1))
|
|
208
197
|
fi
|
|
209
198
|
done
|
|
210
199
|
|
|
211
|
-
local root_count=${#roots_list[@]}
|
|
212
200
|
if (( root_count > 1 )); then
|
|
213
201
|
local has_scripts=0
|
|
214
202
|
local has_tests=0
|
|
215
|
-
for root in
|
|
203
|
+
for root in $roots_list; do
|
|
216
204
|
[[ "$root" == "scripts" ]] && has_scripts=1
|
|
217
205
|
[[ "$root" == "tests" ]] && has_tests=1
|
|
218
206
|
done
|
|
219
|
-
|
|
220
207
|
if [[ $has_scripts -eq 1 && $has_tests -eq 1 && $root_count -eq 2 ]]; then
|
|
221
208
|
printf "${GREEN}✅ Commit %s toca scripts + tests (permitido para bugfixes/features con tests).${NC}\n" "$commit"
|
|
222
209
|
return 0
|
|
223
210
|
fi
|
|
224
|
-
|
|
225
|
-
printf "${RED}❌ Commit %s toca múltiples raíces (%s). Divide los cambios en commits atómicos.${NC}\n" "$commit" "$(printf "%s " "${roots_list[@]}")"
|
|
211
|
+
printf "${RED}❌ Commit %s toca múltiples raíces (%s). Divide los cambios en commits atómicos.${NC}\n" "$commit" "$roots_list"
|
|
226
212
|
return 1
|
|
227
213
|
fi
|
|
228
214
|
if (( root_count == 0 )); then
|
|
@@ -230,7 +216,7 @@ verify_atomic_commit() {
|
|
|
230
216
|
return 0
|
|
231
217
|
fi
|
|
232
218
|
local root_name
|
|
233
|
-
for root_name in
|
|
219
|
+
for root_name in $roots_list; do
|
|
234
220
|
printf "${GREEN}✅ Commit %s cumple atomicidad (raíz %s).${NC}\n" "$commit" "$root_name"
|
|
235
221
|
done
|
|
236
222
|
return 0
|
|
@@ -250,10 +236,9 @@ verify_pending_commits_atomic() {
|
|
|
250
236
|
return $?
|
|
251
237
|
fi
|
|
252
238
|
|
|
253
|
-
local commits=()
|
|
239
|
+
local -a commits=()
|
|
254
240
|
while IFS= read -r commit; do
|
|
255
|
-
[[ -
|
|
256
|
-
commits+=("$commit")
|
|
241
|
+
[[ -n "$commit" ]] && commits+=("$commit")
|
|
257
242
|
done < <($GIT_BIN rev-list "${base_ref}..${branch}")
|
|
258
243
|
local failed=0
|
|
259
244
|
for commit in "${commits[@]}"; do
|
|
@@ -384,50 +369,22 @@ cmd_check() {
|
|
|
384
369
|
local branch
|
|
385
370
|
branch=$(current_branch)
|
|
386
371
|
printf "${CYAN}📍 Rama actual: %s${NC}\n" "$branch"
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
ensure_evidence_fresh || failed=1
|
|
391
|
-
lint_hooks_system || failed=1
|
|
392
|
-
run_mobile_checks || failed=1
|
|
393
|
-
else
|
|
394
|
-
ensure_evidence_fresh || true
|
|
395
|
-
lint_hooks_system || true
|
|
396
|
-
run_mobile_checks || true
|
|
397
|
-
fi
|
|
372
|
+
ensure_evidence_fresh || true
|
|
373
|
+
lint_hooks_system || true
|
|
374
|
+
run_mobile_checks || true
|
|
398
375
|
print_sync_table
|
|
399
376
|
print_cleanup_candidates
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
verify_related_files_commit "HEAD" || failed=1
|
|
404
|
-
fi
|
|
405
|
-
if ! verify_pending_commits_atomic "$branch"; then
|
|
406
|
-
failed=1
|
|
407
|
-
fi
|
|
408
|
-
if [[ "$REQUIRE_TEST_RELATIONS" == "true" ]]; then
|
|
409
|
-
if ! verify_pending_commits_related "$branch"; then
|
|
410
|
-
failed=1
|
|
411
|
-
fi
|
|
412
|
-
fi
|
|
413
|
-
else
|
|
414
|
-
verify_atomic_commit "HEAD" || true
|
|
415
|
-
if [[ "$REQUIRE_TEST_RELATIONS" == "true" ]]; then
|
|
416
|
-
verify_related_files_commit "HEAD" || true
|
|
417
|
-
fi
|
|
377
|
+
verify_atomic_commit "HEAD" || true
|
|
378
|
+
if [[ "$REQUIRE_TEST_RELATIONS" == "true" ]]; then
|
|
379
|
+
verify_related_files_commit "HEAD" || true
|
|
418
380
|
fi
|
|
419
381
|
local pending
|
|
420
382
|
pending=$(unpushed_commits "$branch")
|
|
421
383
|
if [[ "$pending" != "0" ]]; then
|
|
422
384
|
printf "${YELLOW}⚠️ Commits sin subir (${pending}). Ejecuta git push.${NC}\n"
|
|
423
|
-
if [[ "${STRICT_CHECK}" == "true" ]]; then
|
|
424
|
-
failed=1
|
|
425
|
-
fi
|
|
426
385
|
else
|
|
427
386
|
printf "${GREEN}✅ No hay commits pendientes de push.${NC}\n"
|
|
428
387
|
fi
|
|
429
|
-
|
|
430
|
-
return $failed
|
|
431
388
|
}
|
|
432
389
|
|
|
433
390
|
cmd_cycle() {
|
|
@@ -580,7 +537,6 @@ main() {
|
|
|
580
537
|
;;
|
|
581
538
|
esac
|
|
582
539
|
}
|
|
583
|
-
|
|
584
540
|
is_test_file() {
|
|
585
541
|
local file="$1"
|
|
586
542
|
case "$file" in
|
|
@@ -681,14 +637,12 @@ verify_pending_commits_related() {
|
|
|
681
637
|
local base_ref="origin/${branch}"
|
|
682
638
|
|
|
683
639
|
if ! $GIT_BIN show-ref --verify --quiet "refs/remotes/origin/${branch}"; then
|
|
684
|
-
verify_related_files_commit "HEAD"
|
|
685
|
-
return $?
|
|
640
|
+
return verify_related_files_commit "HEAD"
|
|
686
641
|
fi
|
|
687
642
|
|
|
688
|
-
local commits=()
|
|
643
|
+
local -a commits=()
|
|
689
644
|
while IFS= read -r commit; do
|
|
690
|
-
[[ -
|
|
691
|
-
commits+=("$commit")
|
|
645
|
+
[[ -n "$commit" ]] && commits+=("$commit")
|
|
692
646
|
done < <($GIT_BIN rev-list "${base_ref}..${branch}")
|
|
693
647
|
local failed=0
|
|
694
648
|
local commit
|