Skip to content

Commit 5f651b9

Browse files
authored
Merge pull request #5 from 3scale-labs/test
updates
2 parents c8944d0 + d8340df commit 5f651b9

3 files changed

Lines changed: 421 additions & 480 deletions

File tree

agent-dev

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -126,13 +126,12 @@ CLAUDE_SETTINGS_TEMP=$(mktemp)
126126

127127
cat > "$CLAUDE_SETTINGS_TEMP" << 'EOF'
128128
{
129-
"autoApprove": {
130-
"bash": ["*"],
131-
"read": ["*"],
132-
"write": ["*"],
133-
"edit": ["*"]
134-
},
135-
"autoUpdates": false
129+
"permissions": {
130+
"allow": [
131+
"Bash(*:*)",
132+
"WebSearch"
133+
]
134+
}
136135
}
137136
EOF
138137

merge-overlay

Lines changed: 43 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,23 @@ fi
2626
REPO_DIR="$1"
2727
OVERLAY_UPPER="$2"
2828

29+
# Patterns to auto-discard (created by sandbox, should never be merged)
30+
IGNORE_PATTERNS=(
31+
".claude/*" # Claude settings created by bwrap bind
32+
)
33+
34+
# Check if a path matches any ignore pattern
35+
should_ignore() {
36+
local path="$1"
37+
for pattern in "${IGNORE_PATTERNS[@]}"; do
38+
# Use case for reliable glob pattern matching
39+
case "$path" in
40+
$pattern) return 0 ;;
41+
esac
42+
done
43+
return 1
44+
}
45+
2946
# Validate directories
3047
if [[ ! -d "$REPO_DIR" ]]; then
3148
echo "Error: Repository directory does not exist: $REPO_DIR"
@@ -281,12 +298,37 @@ echo ""
281298
# Find all files in overlay (including hidden files, excluding . and ..)
282299
# We need to handle whiteout files (both .wh. prefix and char devices 0/0) and regular files
283300
FILES=()
301+
IGNORED=()
284302
while IFS= read -r -d '' file; do
285303
rel_path="${file#$OVERLAY_UPPER/}"
286-
FILES+=("$rel_path")
304+
if should_ignore "$rel_path"; then
305+
IGNORED+=("$rel_path")
306+
# Auto-discard ignored files
307+
rm -f "$file"
308+
else
309+
FILES+=("$rel_path")
310+
fi
287311
done < <(find "$OVERLAY_UPPER" \( -type f -o -type c \) -print0 | sort -z)
288312

313+
# Report ignored files
314+
if [[ ${#IGNORED[@]} -gt 0 ]]; then
315+
echo "Auto-discarded ${#IGNORED[@]} ignored file(s):"
316+
for f in "${IGNORED[@]}"; do
317+
echo " - $f"
318+
done
319+
echo ""
320+
fi
321+
289322
TOTAL=${#FILES[@]}
323+
324+
# Exit if no files remain after filtering
325+
if [[ $TOTAL -eq 0 ]]; then
326+
# Clean up empty directories
327+
find "$OVERLAY_UPPER" -type d -empty -delete 2>/dev/null || true
328+
echo "✓ No changes in overlay - nothing to merge"
329+
exit 0
330+
fi
331+
290332
echo "Found $TOTAL file(s) to review"
291333
echo ""
292334

0 commit comments

Comments
 (0)