@cratis/pi 7.170.2 → 7.170.3
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.
|
@@ -34,6 +34,8 @@ searches with secret/certificate/key-like prefixes also remain blocked. For ripg
|
|
|
34
34
|
symlinks, not filename-only mode. Literal directory checks retain the process-cwd fallback when the
|
|
35
35
|
payload omits cwd; glob probing does not. Filesystem check/use races remain: this is not a sandbox.
|
|
36
36
|
|
|
37
|
+
The Bash write guard checks manifest and environment-file names against both logical and resolved physical basenames; run `cratis ai update` to receive this change.
|
|
38
|
+
|
|
37
39
|
A Pi session runs guards from its starting checkout. Refresh the corpus there with `cratis ai update`,
|
|
38
40
|
or start a new session in the checkout you change. Selecting a newer installed guard corpus per call
|
|
39
41
|
is tracked in [Cratis/AI#1114](https://github.com/Cratis/AI/issues/1114).
|
|
@@ -377,18 +377,25 @@ manifest_writes_allowed() {
|
|
|
377
377
|
|
|
378
378
|
# Return the category, leaving normal Write/Edit diagnostics unchanged below.
|
|
379
379
|
classify_file() {
|
|
380
|
-
local reference_pattern="${2:-0}"
|
|
380
|
+
local reference_pattern="${2:-0}" physical_base=""
|
|
381
381
|
abspath "$1" "$cwd"; normalize_target_path "$REPLY"; file="$REPLY"
|
|
382
382
|
base_of "$file"; base="$REPLY"
|
|
383
383
|
physical_target_path "$file" || physical_file=""
|
|
384
|
+
if [ -n "$physical_file" ]; then base_of "$physical_file"; physical_base="$REPLY"; fi
|
|
384
385
|
if agent_control_target "$file" || { [ -n "$physical_file" ] && agent_control_target "$physical_file"; }; then
|
|
385
386
|
classification=controls; return 0
|
|
386
387
|
fi
|
|
387
|
-
if names_match "$base" "${manifest_patterns[@]}"; then
|
|
388
|
-
if manifest_writes_allowed; then
|
|
389
|
-
|
|
388
|
+
if names_match "$base" "${manifest_patterns[@]}" || names_match "$physical_base" "${manifest_patterns[@]}"; then
|
|
389
|
+
if manifest_writes_allowed; then
|
|
390
|
+
# Preserve reference-pattern policy when resolution leaves the basename unchanged.
|
|
391
|
+
[ "$base" != "$physical_base" ] || return 1
|
|
392
|
+
else
|
|
393
|
+
classification=manifest; return 0
|
|
394
|
+
fi
|
|
395
|
+
fi
|
|
396
|
+
if names_match "$base" "${environment_patterns[@]}" || names_match "$physical_base" "${environment_patterns[@]}"; then
|
|
397
|
+
classification=environment; return 0
|
|
390
398
|
fi
|
|
391
|
-
if names_match "$base" "${environment_patterns[@]}"; then classification=environment; return 0; fi
|
|
392
399
|
return 1
|
|
393
400
|
}
|
|
394
401
|
|