Tighten Studio instruction-file cleanup boundaries (#7097)

* Handle linked instruction files in Bash cleanup

* Limit instruction cleanup to managed dependencies

* Make Bash cleanup test portable

* Run junction cleanup regression on Windows

* Keep instruction cleanup CI focused
This commit is contained in:
Daniel Han 2026-07-13 01:46:23 -07:00 committed by GitHub
commit c570180a32
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 49 additions and 5 deletions

View file

@ -2339,7 +2339,10 @@ if ((Test-Path $OxcValidatorDir) -and $NodeSource -ne "skip" -and (Get-Command n
substep "OXC validator runtime skipped (no npm found); code validation degrades until Node is available" "Yellow"
}
Remove-AgentInstructionFiles -Roots @($FrontendDir, $OxcValidatorDir)
Remove-AgentInstructionFiles -Roots @(
(Join-Path $FrontendDir "node_modules"),
(Join-Path $OxcValidatorDir "node_modules")
)
# ==========================================================================
# PHASE 3: Python environment + dependencies

View file

@ -79,7 +79,7 @@ _remove_agent_instruction_files() {
for _root in "$@"; do
[ -d "$_root" ] || continue
[ -L "$_root" ] && continue
find "$_root" -type f \( -name 'AGENTS.md' -o -name 'CLAUDE.md' \) \
find "$_root" \( -type f -o -type l \) \( -name 'AGENTS.md' -o -name 'CLAUDE.md' \) \
-exec rm -f {} + 2>/dev/null || true
done
}
@ -857,7 +857,9 @@ elif [ -d "$_OXC_DIR" ] && [ "${NODE_SOURCE:-}" != skip ]; then
substep "OXC validator runtime skipped (no npm found); code validation degrades until Node is available" "$C_WARN"
fi
_remove_agent_instruction_files "$SCRIPT_DIR/frontend" "$_OXC_DIR"
_remove_agent_instruction_files \
"$SCRIPT_DIR/frontend/node_modules" \
"$_OXC_DIR/node_modules"
# ── Python venv + deps ──