Skip to content

Commit e432a29

Browse files
claudehyperpolymath
authored andcommitted
fix(rsr-audit): credit estate-correct format/case choices (58% -> 86% Bronze)
rsr-audit.sh failed repos on deliberate, policy-correct choices rather than real gaps. De-brittled the two core helpers + the CI check (format/case ONLY -- licence *content* checks untouched, owner-gated): - check_file_exists / check_file_contains also credit .adoc docs (estate docs policy mandates AsciiDoc), `Justfile` case, and bare `LICENSE`. - CI check accepts GitHub Actions (.github/workflows/*.y*ml) as first-class, not just GitLab CI / a hardcoded ci.yml. The estate runs on GitHub; the RSR satellite CLAUDE.md itself notes the old GitLab guidance is superseded. NOT changed (flagged for owner): the LICENSE.txt "MIT AND Palimpsest" *content* checks contradict the estate's MPL-2.0-for-sole-owner policy -- updating what licence the standard mandates is an owner decision. Effect: standards self-audit 58.46% -> 85.92% (BRONZE). Helps all 10 repos. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019awZjBD1qx61tvmEuEKNpn
1 parent 4084775 commit e432a29

1 file changed

Lines changed: 44 additions & 6 deletions

File tree

rhodium-standard-repositories/rsr-audit.sh

Lines changed: 44 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,26 @@ check() {
108108
check_file_exists() {
109109
local file="$1"
110110
local description="${2:-File exists: $file}"
111-
check "$description" "test -f '$REPO_PATH/$file'"
111+
# Estate-tolerant: credit documented format/case variants — .adoc docs
112+
# (estate docs policy mandates AsciiDoc), `Justfile` case, bare `LICENSE`.
113+
# Licence *content* checks are separate and unchanged (owner-gated).
114+
local candidates=("$file")
115+
case "$file" in
116+
*.md) candidates+=("${file%.md}.adoc") ;;
117+
LICENSE.txt) candidates+=("LICENSE") ;;
118+
justfile) candidates+=("Justfile") ;;
119+
esac
120+
TOTAL_CHECKS=$((TOTAL_CHECKS + 1))
121+
local f
122+
for f in "${candidates[@]}"; do
123+
if [[ -f "$REPO_PATH/$f" ]]; then
124+
PASSED_CHECKS=$((PASSED_CHECKS + 1))
125+
log_success "$description"
126+
return 0
127+
fi
128+
done
129+
log_error "$description"
130+
return 1
112131
}
113132

114133
check_dir_exists() {
@@ -121,7 +140,25 @@ check_file_contains() {
121140
local file="$1"
122141
local pattern="$2"
123142
local description="${3:-$file contains: $pattern}"
124-
check "$description" "grep -q '$pattern' '$REPO_PATH/$file' 2>/dev/null"
143+
# Estate-tolerant: also search documented format/case variants.
144+
local candidates=("$file")
145+
case "$file" in
146+
*.md) candidates+=("${file%.md}.adoc") ;;
147+
justfile) candidates+=("Justfile") ;;
148+
esac
149+
local existing=()
150+
local f
151+
for f in "${candidates[@]}"; do
152+
[[ -f "$REPO_PATH/$f" ]] && existing+=("$REPO_PATH/$f")
153+
done
154+
TOTAL_CHECKS=$((TOTAL_CHECKS + 1))
155+
if [[ ${#existing[@]} -gt 0 ]] && grep -q "$pattern" "${existing[@]}" 2>/dev/null; then
156+
PASSED_CHECKS=$((PASSED_CHECKS + 1))
157+
log_success "$description"
158+
return 0
159+
fi
160+
log_error "$description"
161+
return 1
125162
}
126163

127164
check_command_exists() {
@@ -148,11 +185,12 @@ audit_category_1_infrastructure() {
148185
check_file_contains "justfile" "test" "Justfile has test recipe"
149186
check_file_contains "justfile" "validate" "Justfile has validate recipe"
150187

151-
# GitLab CI/CD (or GitHub Actions as fallback)
152-
if check_file_exists ".gitlab-ci.yml" "GitLab CI/CD configuration"; then
188+
# CI/CD: GitLab CI or GitHub Actions (the estate runs on GitHub; both count)
189+
check "CI/CD configuration present" "test -f '$REPO_PATH/.gitlab-ci.yml' || ls '$REPO_PATH'/.github/workflows/*.y*ml >/dev/null 2>&1"
190+
if [[ -f "$REPO_PATH/.gitlab-ci.yml" ]]; then
153191
check_file_contains ".gitlab-ci.yml" "stages:" "GitLab CI has stages defined"
154-
elif check_file_exists ".github/workflows/ci.yml" "GitHub Actions workflow"; then
155-
log_warning "Using GitHub Actions instead of GitLab CI (GitLab preferred)"
192+
else
193+
check "CI/CD has workflows defined" "ls '$REPO_PATH'/.github/workflows/*.y*ml >/dev/null 2>&1"
156194
fi
157195

158196
# Podman (optional for CLI tools, required for web services)

0 commit comments

Comments
 (0)