You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Deletion-guard PR-body marker, BotId::Oikosbot, rhodibot link fix (#298)
Follow-ups after the sustainabot→oikosbot extraction (#297). Companion
PR: **hyperpolymath/oikosbot** branch `claude/determined-cerf-s4zaob`.
## Matter 1 — Repo Integrity Guard
When #297 deleted the 98 vendored files, the guard fired and the PR was
merged via override. Root cause (besides not knowing the marker): the
guard's own comment promises `[mass-delete-ok]` works in "a commit
message **or the PR title/body**", but the code only grepped commit
messages.
- **Implement the documented PR-title/body escape hatch** (via `env:` +
`grep -F`, injection-safe — untrusted PR text is never `eval`'d).
Accidental stale-base gut-merges are still blocked; only
explicitly-marked intentional removals pass. **The guard is not
weakened** — threshold and critical-file checks are unchanged.
- **CLAUDE.md invariant #7** documents the tripwire + marker convention
so future cleanups are marked, not force-merged.
## Matter 2b — fix rhodibot's broken sibling link
`bots/rhodibot/README.adoc` linked the non-existent
`hyperpolymath/sustainabot` repo. Repointed to the in-repo slot
`bots/sustainabot/` and clarified it's the **reserved fleet slot, not**
the standalone OikosBot (avoids re-creating the conflation).
## Matter 2c (fleet side) — distinct identity for OikosBot
- Add **`BotId::Oikosbot`** to `shared-context` so the optional
`oikosbot-fleet` bridge can publish under its own identity instead of
borrowing `BotId::Sustainabot`. Modelled on `Custom`: **deliberately
excluded from `BotId::all()`**, so the bot roster and coordinator
dispatch are unchanged — OikosBot is an *external publisher*, not a
managed roster bot. (`+22/−1` in `bot.rs`; **84 shared-context tests
pass**.)
### Notes
- `robot-repo-automaton` has a **pre-existing, unrelated** build error
in `src/detector.rs` (regex `is_match` wants `&str`, gets `&Vec<u8>`) —
present on `main` before this change, out of scope here.
- I deliberately avoided running `cargo fmt` (the crate has pre-existing
rustfmt drift); the diff is the minimal `bot.rs` change only.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01RozeeLxpJsd3WWFngaZWz3
---
_Generated by [Claude
Code](https://claude.ai/code/session_01RozeeLxpJsd3WWFngaZWz3)_
Co-authored-by: Claude <noreply@anthropic.com>
# Untrusted PR text — consumed only via env + grep -F (never eval'd).
69
+
PR_TITLE: ${{ github.event.pull_request.title }}
70
+
PR_BODY: ${{ github.event.pull_request.body }}
68
71
run: |
69
72
set -euo pipefail
70
73
@@ -86,14 +89,18 @@ jobs:
86
89
echo "Deleted tracked files vs $base: $deleted (limit ${MAX_DELETIONS})"
87
90
88
91
# Intentional large removals: put [mass-delete-ok] in any commit
89
-
# message in the range (or the PR title/body).
92
+
# message in the range, or in the PR title/body.
90
93
if git log --format='%B' "${base}..${HEAD_SHA}" | grep -qF '[mass-delete-ok]'; then
91
-
echo "Override marker [mass-delete-ok] present — tripwire bypassed by intent."
94
+
echo "Override marker [mass-delete-ok] present in a commit message — tripwire bypassed by intent."
95
+
exit 0
96
+
fi
97
+
if printf '%s\n%s\n' "${PR_TITLE:-}" "${PR_BODY:-}" | grep -qF '[mass-delete-ok]'; then
98
+
echo "Override marker [mass-delete-ok] present in the PR title/body — tripwire bypassed by intent."
92
99
exit 0
93
100
fi
94
101
95
102
if [ "$deleted" -gt "${MAX_DELETIONS}" ]; then
96
-
echo "::error::$deleted files deleted vs base (limit ${MAX_DELETIONS}). If intentional, add [mass-delete-ok] to a commit message in this change. Refusing to let main be silently gutted again."
103
+
echo "::error::$deleted files deleted vs base (limit ${MAX_DELETIONS}). If intentional, add [mass-delete-ok] to a commit message OR the PR title/body. Refusing to let main be silently gutted again."
97
104
git diff --diff-filter=D --name-only "$base" "$HEAD_SHA" | head -40 | sed 's/^/ deleted: /'
description:"External ecological/economic code-analysis App (hyperpolymath/oikosbot) that publishes via the optional oikosbot-fleet bridge — distinct from the reserved Sustainabot slot".to_string(),
0 commit comments