feat(rhodibot): add offline check CLI subcommand for CI gating#150
Merged
Conversation
rhodibot was webhook-server-only (axum, `--port`), with no way to run a one-shot RSR compliance check from CI. Consumers (e.g. ubicity #37) tried to invoke a non-existent `rhodibot check --owner X --repo Y` CLI. Add a `check` subcommand that runs `rsr::check_compliance` against a remote repo via the GitHub REST API (honours `GITHUB_TOKEN`; works unauthenticated on public repos), prints a pretty/json report, and exits non-zero when required checks fail — so it can gate CI directly. The server remains the default behaviour when no subcommand is given, so existing deployments are unaffected. Also fix a pre-existing compile error in integration_tests.rs (`Hmac::new_from_slice` needs `KeyInit` in scope) so `cargo test` is green for the crate. fmt + clippy + 48 tests pass. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This was referenced May 16, 2026
hyperpolymath
added a commit
to hyperpolymath/ubicity
that referenced
this pull request
May 16, 2026
#37) (#42) ## Summary Re-enables the three bot checks disabled in #36. They were permanent false-red because they cloned **phantom repos** (`hyperpolymath/finishing-bot`, `/seambot`, `/rhodibot`) that never existed. The bots actually live in **`hyperpolymath/gitbot-fleet`** under `bots/`. Each workflow now: clones `gitbot-fleet` at a **pinned commit** (partial clone + checkout SHA), builds the specific bot crate, runs the **correct binary**, then the `if: false` guard is removed. | Bot | Root cause fixed | Invocation | |---|---|---| | finishingbot | phantom clone **+ wrong binary name** (`finishingbot` → crate binary is `finishing-bot`) | `finishing-bot --path "$GITHUB_WORKSPACE" audit` | | seambot | phantom clone | `seambot check` (keeps the `spec/seams/seam-register.json` guard) | | rhodibot | phantom clone **+ rhodibot had no CLI** (was webhook-server-only) | `rhodibot check --owner --repo`, built-in read-only `GITHUB_TOKEN` (public repo, no PAT) | ## Dependency rhodibot needs the new `rhodibot check` subcommand added in **hyperpolymath/gitbot-fleet#150**. The pinned ref is currently that PR's branch HEAD (`2e0ea3ca67821a91e650f51bf48a6cfd1c7aae1c`); it will be **bumped to the post-merge `main` SHA** once #150 lands. Do not merge this before that bump. ## Tracking `Refs #37`. Native sub-issues: #39 (seambot), #40 (finishingbot — binary-name bug), #41 (rhodibot — blocked on gitbot-fleet#150). Per estate workflow, #37 closes only on explicit joint agreement. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
🔍 Hypatia Security ScanFindings: 100 issues detected
View findings[
{
"reason": "Obj.magic bypassing type safety (2 occurrences, CWE-704)",
"type": "obj_magic",
"file": "/home/runner/work/gitbot-fleet/gitbot-fleet/bots/sustainabot/bot-integration/src/Analysis.res",
"action": "flag",
"rule_module": "code_safety",
"severity": "high"
},
{
"reason": "Obj.magic bypassing type safety (2 occurrences, CWE-704)",
"type": "obj_magic",
"file": "/home/runner/work/gitbot-fleet/gitbot-fleet/bots/sustainabot/bot-integration/lib/ocaml/Analysis.res",
"action": "flag",
"rule_module": "code_safety",
"severity": "high"
},
{
"reason": "expect() in hot path (1 occurrences, CWE-754)",
"type": "expect_in_hot_path",
"file": "/home/runner/work/gitbot-fleet/gitbot-fleet/bots/gsbot/src/services.rs",
"action": "flag",
"rule_module": "code_safety",
"severity": "medium"
},
{
"reason": "expect() in hot path (3 occurrences, CWE-754)",
"type": "expect_in_hot_path",
"file": "/home/runner/work/gitbot-fleet/gitbot-fleet/bots/glambot/src/analyzers/accessibility.rs",
"action": "flag",
"rule_module": "code_safety",
"severity": "medium"
},
{
"reason": "expect() in hot path (3 occurrences, CWE-754)",
"type": "expect_in_hot_path",
"file": "/home/runner/work/gitbot-fleet/gitbot-fleet/bots/finishingbot/src/analyzers/claims.rs",
"action": "flag",
"rule_module": "code_safety",
"severity": "medium"
},
{
"reason": "expect() in hot path (1 occurrences, CWE-754)",
"type": "expect_in_hot_path",
"file": "/home/runner/work/gitbot-fleet/gitbot-fleet/bots/finishingbot/src/analyzers/license.rs",
"action": "flag",
"rule_module": "code_safety",
"severity": "medium"
},
{
"reason": "expect() in hot path (1 occurrences, CWE-754)",
"type": "expect_in_hot_path",
"file": "/home/runner/work/gitbot-fleet/gitbot-fleet/bots/accessibilitybot/src/analyzers/aria.rs",
"action": "flag",
"rule_module": "code_safety",
"severity": "medium"
},
{
"reason": "expect() in hot path (5 occurrences, CWE-754)",
"type": "expect_in_hot_path",
"file": "/home/runner/work/gitbot-fleet/gitbot-fleet/bots/accessibilitybot/src/analyzers/forms.rs",
"action": "flag",
"rule_module": "code_safety",
"severity": "medium"
},
{
"reason": "expect() in hot path (4 occurrences, CWE-754)",
"type": "expect_in_hot_path",
"file": "/home/runner/work/gitbot-fleet/gitbot-fleet/bots/accessibilitybot/src/analyzers/media.rs",
"action": "flag",
"rule_module": "code_safety",
"severity": "medium"
},
{
"reason": "expect() in hot path (2 occurrences, CWE-754)",
"type": "expect_in_hot_path",
"file": "/home/runner/work/gitbot-fleet/gitbot-fleet/bots/accessibilitybot/src/analyzers/language.rs",
"action": "flag",
"rule_module": "code_safety",
"severity": "medium"
}
]Powered by Hypatia Neurosymbolic CI/CD Intelligence |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
rhodibotis currently a webhook-server-only binary (axum,--portflag). There is no CLI scan mode, so consumer repos that try to run
rhodibot check --owner X --repo Yin CI (e.g.hyperpolymath/ubicityissue #37) cannot — the invocation is architecturally impossible against
the code as shipped.
What
checksubcommand:rhodibot check --owner <o> --repo <r> [--format pretty|json].It calls the existing
rsr::check_complianceagainst the GitHub RESTAPI (honours
GITHUB_TOKENfor rate limits / private repos; worksunauthenticated on public repos), prints a report, and exits
non-zero when required checks fail so it can gate CI directly.
existing deployments are unaffected.
tests/integration_tests.rs(
Hmac::new_from_sliceneeds theKeyInittrait in scope) socargo testis green for the crate.Validation
cargo fmt,cargo clippy --bins(clean),cargo build --release,cargo test(48 passed).rhodibot check --helprenders correctly.Unblocks
hyperpolymath/ubicity#37.🤖 Generated with Claude Code