Skip to content

fix: CodeRabbit auto-fixes for PR #764 - #1281

Open
coderabbitai[bot] wants to merge 4 commits into
mainfrom
coderabbitai/autofix/ce768a6
Open

coderabbitai[bot] wants to merge 4 commits into
mainfrom
coderabbitai/autofix/ce768a6

Conversation

@coderabbitai

@coderabbitai coderabbitai Bot commented Oct 17, 2026

Copy link
Copy Markdown
Contributor

This follow-up PR contains CodeRabbit auto-fixes for #764.

Files modified:

  • scripts/apply-baseline.sh
  • scripts/plan-ruleset-constraint-repair.rb
  • scripts/tests/science-ci-security-test.rb

Fixed 3 file(s) based on 2 failed pre-merge checks.

Co-authored-by: CodeRabbit <noreply@coderabbit.ai>
@coderabbitai

coderabbitai Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor Author

Important

Review skipped

This PR was authored by a bot without an assigned CodeRabbit review seat. Ask an organization administrator to assign a seat to the bot. See the seat-assignment guide. After the seat is assigned, request a review again.

⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Essentials
  • Run ID: 0bf5910e-d3a9-4d75-af48-ef34c8b23a0d

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 17, 2026 •

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-18T13:49:15.143308Z a5240fa 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.

@github-actions

github-actions Bot commented Oct 17, 2026 •

Copy link
Copy Markdown
Contributor

DEED–K9 green

🟢 conformant · commit a5240fa39de9 · run 39133096985

Category Status Pass Fail Indeterminate N/A Since previous revision
DEED syntax 🟢 conformant 4 0 0 0 ↔ unchanged
K9 contract typecheck 🟢 conformant 1 0 0 0 ↔ unchanged
K9 validator self-test 🟢 conformant 34 0 0 0 ↔ unchanged
K9 positive/negative controls 🟢 conformant 27 0 0 0 ↔ unchanged
K9 live corpus (L0–L2) 🟢 conformant 12 0 0 2 ↔ unchanged
K9 live corpus (L0–L2): 2 finding(s) / scope notes
  • 2-protocols/k9-coordination/examples/minimal.k9 — not_applicable: Routed to another dialect; not validated as a K9 contract.
  • coordination.k9 — not_applicable: Routed to another dialect; not validated as a K9 contract.

Scope: DEED syntax and K9 contracts L0–L2. L3 signature verification and routed coordination dialects are not certified. Green is limited to this scope. Orange is missing evidence; grey is an explicit scope exclusion. Logs and report.json are in the dated conformance-evidence artifact on the linked run.

@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: 6388705d00

ℹ️ About Codex in GitHub

Codex has been enabled to automatically 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 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread scripts/apply-baseline.sh
# `informational`. Without these, research findings can never be
# acknowledged and the baseline gate can never go green on them.
def sevs: ["critical","high","medium","warn","low","info","informational"];
def sevs: ["critical","high","medium","low","info"];

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 Restore every severity accepted by the scanner

The inspected Hypatia workflow accepts warn and informational, and the authoritative baseline schema permits both, but this validator now rejects them. The repository's own .hypatia-baseline.json contains numerous warn entries, so whenever a nonempty scan invokes this script, it exits 2 before filtering any findings and breaks the baseline-backed gate.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

can you deal with this @CodeRabbit

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@hyperpolymath I’ll route this fix to the coding workflow.

  • Restore warn and informational in the sevs list in scripts/apply-baseline.sh.
  • Check that the validator matches the authoritative baseline schema and scanner vocabulary.
  • Add regression tests for both aliases, including suppression, severity overrides, and blocking ranks.

The fix is not yet implemented or verified.


Failed to start Coding Agent task. Please try again.

You are interacting with an AI system.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

please implement, @CodeRabbit

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@hyperpolymath I’ll retry the coding workflow for this fix. The previous attempt did not start.

  • Restore warn and informational in the baseline validator.
  • Check consistency with the baseline schema and scanner.
  • Add regression tests and run them in the coding workflow.

The fix is not yet implemented or verified.


Failed to start Coding Agent task. Please try again.

You are interacting with an AI system.

Comment thread scripts/apply-baseline.sh
Comment on lines +89 to 91
(["severity","rule_module","type"][]
| select(($e[.]|type) != "string")
| "entry[\($i)]: required key \(.) missing or not a string"),

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 Honor array-valued rule modules

The authoritative schema and format documentation allow rule_module to be a nonempty string array so one acknowledgement can cover the same defect emitted by multiple modules. Requiring this field to be a string rejects those valid baselines with exit 2; validation must retain the array form, and matching must test membership rather than exact array-to-string equality.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

please address @CodeRabbit

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

📌 Tracking this review finding. CodeRabbit will verify future changes against the original feedback and will only mark it fixed when the code satisfies it.

Comment thread scripts/apply-baseline.sh
(.rule_module | if type == "array" then . else [.] end)
| any(. == $finding.rule_module)
)
.severity == $finding.severity

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 Preserve warn-to-medium baseline compatibility

For legacy acknowledgements written with warn, Hypatia now emits the same findings as medium; exact equality therefore marks an acknowledged finding as new and can fail a blocking gate. The existing baseline regression suite explicitly covers matching these two representations in both directions, so the severity-tier normalization should remain.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

good thinking @CodeRabbit, can you address it?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@hyperpolymath I’ll start the code-change workflow to restore warn ↔ medium compatibility.

  • Restore severity-tier normalisation in scripts/apply-baseline.sh.
  • Ensure baseline validation accepts legacy warn entries and stays aligned with .machine_readable/hypatia-baseline.schema.json.
  • Check regression coverage for both matching directions and blocking-gate behaviour.

Failed to start Coding Agent task. Please try again.

You are interacting with an AI system.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

please address, @CodeRabbit

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@hyperpolymath I’ll retry the code-change workflow with the following scope.

  • Restore warn ↔ medium baseline matching.
  • Accept legacy warn baseline entries in both validation layers.
  • Verify regression coverage and blocking-gate behaviour.

Failed to start Coding Agent task. Please try again.

You are interacting with an AI system.

# invalid element shape, unknown severity, and multiple JSON documents
['', " \n", '[', '{}', 'null', '[{}]', '[{"severity":"unknown"}]', '[] []', "[]\n[{\"severity\":\"high\"}]"].each do |invalid|
# Test invalid inputs - flat array format
['', '[', '[]', '[{}]', '[{"severity":"unknown"}]'].each do |invalid|

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 Keep an empty findings array as a valid control

A clean scan legitimately produces [], and the workflow under test explicitly accepts it and emits zero counts. Adding [] to this invalid-input loop therefore makes science-ci-security-test.rb fail every time; the inspected self-test.yml discovers and runs its shell wrapper, so this change leaves the required self-test job red.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

yes, please address this @CodeRabbit

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

📌 Tracking this review finding. CodeRabbit will verify future changes against the original feedback and will only mark it fixed when the code satisfies it.

Comment thread scripts/apply-baseline.sh

if (( MAX_KEPT_RANK >= THRESHOLD_RANK )); then
echo "::error::Gate failed: $BLOCKING_COUNT unfiltered finding(s) at or above '$BLOCKING_THRESHOLD' ($KEPT_COUNT kept in total)." >&2
echo "::error::Gate failed: $KEPT_COUNT unfiltered finding(s) at or above '$BLOCKING_THRESHOLD'." >&2

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 Count only findings meeting the blocking threshold

When kept findings contain mixed severities, this message reports every kept finding as being at or above the threshold. For example, one high plus one info at a high threshold reports two blocking findings even though only one qualifies, producing misleading gate diagnostics; retain a separate at-or-above-threshold count.

Useful? React with 👍 / 👎.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

yes, @CodeRabbit can you fix this one too?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

📌 Tracking this review finding. CodeRabbit will verify future changes against the original feedback and will only mark it fixed when the code satisfies it.

@coderabbitai

coderabbitai Bot commented Oct 18, 2026

Copy link
Copy Markdown
Contributor Author

Add Carrot credits or activate Agent usage billing to use Autofix

@sonarqubecloud

Copy link
Copy Markdown

This branch has not been deployed

No deployments
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.

1 participant