Skip to content

feat(dispatch): report group E repository settings to the owner - #1094

Merged
hyperpolymath merged 6 commits into
mainfrom
claude/r1-group-e-report
Nov 14, 2026
Merged

hyperpolymath merged 6 commits into
mainfrom
claude/r1-group-e-report

Conversation

@hyperpolymath

@hyperpolymath hyperpolymath commented Nov 14, 2026 •

Copy link
Copy Markdown
Owner

Summary

Follow-up to #1088, from the owner's answer on #1080 (2026-11-14): group E is reported to the owner.

The 4 repository-settings recipes (scorecard-branch-protection, scorecard-code-review, scorecard-webhooks, scorecard-signed-releases) no longer auto-execute. A commit cannot fix a repository setting, so a bot should not try one. Hypatia now sends the finding to the owner as an advisory.

  • .machine_readable/fix-ownership-policy.json gains a report_to_owner list (group E).
  • TriangleRouter.ownership_cap/1 returns :report_to_owner for these recipes, so recipe_strategy/1 is report_only whatever the confidence. The manifest entries carry ownership_cap: "report_to_owner".
  • The FleetDispatcher advisory text says "report to owner: a repository setting no commit can fix".

Group F (seeds and Hypatia operations) still keeps its confidence tier.

Manual reconciler (Codex P1, owner answer 2026-11-14): mix hypatia.reconcile changed branch protection and required reviews (BranchProtectionID, CodeReviewID) through the GitHub settings API by default. It now escalates them to the owner by default. ScorecardReconciler.reconcile/3 defaults to :conservative, and the mix task changes settings only with the new --apply-settings flag. --conservative is still accepted, and it wins if both flags are given. Settings findings escalated this way now count in the summary's escalated total.

Known, not changed here: recipe-scorecard-signed-releases and recipe-scorecard-webhooks target the categories SignedReleases and Webhooks, but ScorecardIngestor emits ReleaseSigning and WebhookSecurity. So RecipeMatcher never selects these 2 recipes (this is already so on main). Their findings take the generic control route, which is a report-only advisory, so the owner's "report, no fix" result already holds. Aligning the categories would only change the advisory text.

Test plan

  • test/fix_ownership_cap_test.exs: group E moves from the uncapped list to the capped list, and must be report_only even at confidence 0.99. Group F is still checked as uncapped.
  • Mutation check: with the group E list emptied, the group E test fails.
  • test/scorecard_reconciler_test.exs: new tests pin the reconcile/3 default and the mix task flags. With the old :full_auto default restored, the reconcile/3 test fails.
  • escalated?/1 test: a default-escalated settings finding counts as escalated; it fails when that clause is removed.
  • Full Elixir suite (OTP 27.3.4.19, Elixir 1.17.3): 3161 tests, 0 failures, 246 excluded. mix compile --warnings-as-errors is clean; changed files are formatted.

Generated by Claude Code

Owner answer on #1080 (2026-11-14): the 4 repository-settings recipes
(scorecard-branch-protection, scorecard-code-review, scorecard-webhooks,
scorecard-signed-releases) no longer auto-execute. A commit cannot fix
a repository setting, so Hypatia reports the finding to the owner.

- fix-ownership-policy.json gains a report_to_owner list (group E).
- TriangleRouter.ownership_cap/1 returns :report_to_owner for them, so
  recipe_strategy/1 is report_only whatever the confidence.
- FleetDispatcher's advisory says "report to owner: a repository
  setting no commit can fix".
- test/fix_ownership_cap_test.exs moves group E from the uncapped list
  to the capped list. Group F stays uncapped.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0136P7Zo6VBPrBWYUmDJZR1H
@coderabbitai

coderabbitai Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 45 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 08b78801-f71c-4f61-a429-480a059ae5ee
Commits

Reviewing files that changed from the base of the PR and between 33cbe66 and 6076270.

Files selected for processing: 7

  • .machine_readable/fix-ownership-policy.json
  • lib/fleet_dispatcher.ex
  • lib/mix/tasks/hypatia.reconcile.ex
  • lib/scorecard_reconciler.ex
  • lib/triangle_router.ex
  • test/fix_ownership_cap_test.exs
  • test/scorecard_reconciler_test.exs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@hyperpolymath
hyperpolymath marked this pull request as ready for review November 14, 2026 15:33
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-14T18:03:54.469006Z 6076270 New commits
🔒 Security Review ✅ Completed 2026-11-14T18:04:47.667186Z 6076270 New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: eb3ffae2d0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment on lines +30 to +31
"recipe-scorecard-branch-protection",
"recipe-scorecard-code-review",

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P1 Badge Apply the owner cap to Scorecard reconciliation

When mix hypatia.reconcile owner/repo runs without --conservative (the documented default), ScorecardReconciler still classifies BranchProtectionID and CodeReviewID as :fix_settings and calls do_fix_settings/3, which updates branch protection through the GitHub API (lib/scorecard_reconciler.ex:71,106-112,141-172,326-365). This new cap is consulted only by TriangleRouter using recipe IDs, so those two group-E findings can still auto-mutate repository settings instead of being reported to the owner; the reconciler path must also honor this policy.

Useful? React with 👍 / 👎.

Owner answer on #1080 group E (2026-11-14), after a Codex P1 on #1094:
mix hypatia.reconcile changed branch protection and required reviews
(BranchProtectionID, CodeReviewID) through the GitHub settings API
unless --conservative was given. It now escalates them to the owner by
default.

- ScorecardReconciler.reconcile/3 defaults to policy :conservative
  (policy/1). :full_auto applies settings only when asked for.
- The mix task applies settings only on the new --apply-settings flag;
  --conservative is still accepted and wins if both are given.
- Tests pin both defaults; with the old :full_auto default restored,
  the reconcile/3 test fails.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0136P7Zo6VBPrBWYUmDJZR1H

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 7425d68a0b

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

# :conservative (default, owner answer on hypatia#1080 group E, 2026-11-14)
# escalates settings findings for the owner; :full_auto auto-applies
# :fix_settings via the settings API only when the caller asks for it. (#265)
def policy(opts), do: Keyword.get(opts, :policy, :conservative)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Include default settings escalations in the summary

When the default reconciliation encounters BranchProtectionID or CodeReviewID, this policy now records each result as acted: :escalated_conservative, but the returned escalated total still counts only action == :open_escalate. Consequently, the documented default can escalate settings findings while reporting escalated: 0, giving callers and operators an inaccurate reconciliation summary; count :escalated_conservative results there as well.

Useful? React with 👍 / 👎.

Comment on lines +32 to +33
"recipe-scorecard-webhooks",
"recipe-scorecard-signed-releases"

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Align the new caps with routed Scorecard patterns

For actual Signed-Releases and Webhooks results, ScorecardIngestor emits categories ReleaseSigning and WebhookSecurity, while these recipes target SignedReleases and Webhooks; their dynamic pattern IDs also do not equal the recipes' IDs, and fuzzy matching compares SC017/SC020 against SC-017-*/SC-020-*. Thus RecipeMatcher.best_recipe_for_pattern/2 never selects either newly capped recipe, so those findings take the generic control route without the report_to_owner cap or its owner-specific advisory. Align the recipe categories or matching identifiers and add an end-to-end routing assertion for both entries.

Useful? React with 👍 / 👎.

claude and others added 3 commits November 14, 2026 16:38
Codex P2 on #1094: with :conservative as the default, BranchProtectionID
and CodeReviewID results are recorded as acted :escalated_conservative,
but the summary's escalated total counted only :open_escalate, so a
default run reported escalated: 0. escalated?/1 now counts both. The
taxonomy comment now states the new default.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_0136P7Zo6VBPrBWYUmDJZR1H
@hyperpolymath
hyperpolymath merged commit b660d08 into main Nov 14, 2026
4 checks passed
@hyperpolymath
hyperpolymath deleted the claude/r1-group-e-report branch November 14, 2026 18:01
@sonarqubecloud

Copy link
Copy Markdown

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants