Skip to content

chore(agents): enforce OSS isolation with a mechanical pre-push guard - #369

Merged
ThePlenkov merged 1 commit into
mainfrom
chore/oss-guard
Nov 20, 2026
Merged

ThePlenkov merged 1 commit into
mainfrom
chore/oss-guard

Conversation

@ThePlenkov

@ThePlenkov ThePlenkov commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

Enforces strict Open Source Software (OSS) isolation for all contributions targeting public GitHub repositories.

This change introduces a mandatory preflight guard (scripts/oss-github-guard.sh) to prevent internal context (e.g., corporate hostnames, internal system codenames, internal MR numbers, corporate email domains) from appearing in public artifacts.

Impact includes:

  • Scans PR titles, bodies, comments, branch names, and commit metadata before pushing to github.com.
  • Allows scanning of live PRs via gh CLI.
  • Provides guidance on sanitizing internal work into public-facing descriptions.

This rule is enforced globally via updates to AGENTS.md and documented in .agents/rules/git/oss-isolation.md. The guard uses organization-specific patterns found in the untracked file scripts/.oss-guard-local.patterns.

Requirement: Any attempt to push or interact with a public GitHub remote will halt with a non-zero exit if forbidden patterns are found; users must sanitize content before proceeding.

Summary by Sourcery

Enforce removal of internal context from all contributions targeting public GitHub repositories.

New Features:

  • Add a mechanical guard that scans public GitHub pushes and pull-request content for forbidden internal context.
  • Support scanning live pull requests and arbitrary files through the guard CLI.

Enhancements:

  • Define a mandatory OSS isolation policy covering public contribution content, metadata, and author identities.

Documentation:

  • Document the OSS isolation policy and required preflight workflow for agents and contributors.

Chores:

  • Update repository agent guidance to require the OSS guard before public GitHub interactions.

@amazon-q-developer

Copy link
Copy Markdown
Contributor

Warning

Amazon Q Developer for GitHub: end of support

On January 30, 2027, AWS will discontinue support for the Amazon Q Developer for GitHub App. New app installations will no longer be available starting November 18, 2026.

For capabilities similar to the Amazon Q Developer for GitHub App, explore Kiro and the Kiro GitHub App. For more information about the end of support, see Amazon Q Developer end-of-support announcement on the AWS DevOps Blog.

@codeant-ai

codeant-ai Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

CodeAnt  CodeAnt Review Status

✅  Review completed

Status Commit Started (UTC) Finished (UTC)
✅  #d74ee Reviewed your PR c197638 Nov 20, 2026 · 13:05 13:13

@sourcery-ai

sourcery-ai Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Reviewer's Guide

Implementation

Read the guard’s scanning and pre-push logic, which implements the mechanical checks for public GitHub contributions.

  • scripts/oss-github-guard.sh L1-84

Configuration

Read the agent instructions, ignore-file change, and OSS isolation rule together to understand how the guard is intended to be used and enforced.

  • .agents/rules/git/oss-isolation.md L1-71
  • .gitignore L193
  • AGENTS.md L35, L86-94, L117-132

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@codeant-ai

codeant-ai Bot commented Nov 20, 2026

Copy link
Copy Markdown

Thanks for using CodeAnt! 🎉

We're free for open-source projects. if you're enjoying it, help us grow by sharing.

Share on X ·
Reddit ·
LinkedIn

@kody-ai

This comment has been minimized.

@coderabbitai

coderabbitai Bot commented Nov 20, 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 51 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: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ccef00eb-abed-42c2-bb6d-7625f4a9699d
Commits

Reviewing files that changed from the base of the PR and between 6205d18 and 8837db3.

Files selected for processing: 4

  • .agents/rules/git/oss-isolation.md
  • .gitignore
  • AGENTS.md
  • scripts/oss-github-guard.sh
  • 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

@baz-reviewer

baz-reviewer Bot commented Nov 20, 2026

Copy link
Copy Markdown

Review this PR on Baz

Merger

Waiting for CI and review to complete.


@ThePlenkov
ThePlenkov enabled auto-merge (squash) November 20, 2026 13:05
@netlify

netlify Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for adt-cli canceled.

Name Link
🔨 Latest commit 8837db3
🔍 Latest deploy log https://app.netlify.com/projects/adt-cli/deploys/6b004765e1f883dd799a660d

@gitar-bot

gitar-bot Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Gitar is working

Verification

Rules No rules evaluated

Functional validation Not enabled

Set up

Auto-approval Not enabled

Set up

Gitar

@codeant-ai codeant-ai Bot added the size:L This PR changes 100-499 lines, ignoring generated files label Nov 20, 2026

@amazon-q-developer amazon-q-developer Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Review Summary

This PR adds a mechanical OSS isolation gate (pre-push hook + agent rule + .gitignore entry). The overall approach is sound and the structure is clean. Two logic defects in scripts/oss-github-guard.sh need fixing before merge:

  1. New-branch range is unbounded (line 66–68): When remote_sha is all-zeros (first push of a branch), range="$local_sha" causes git log to walk the entire ancestry of the commit rather than only the new commits being pushed. This makes the scan both incorrect in scope and prohibitively slow on repos with long history.

  2. gh failure silently produces a false "clean" result (lines 45–46): Piping gh pr view ... 2>/dev/null | scan ... swallows gh's exit code. Any gh error (unauthenticated, wrong repo, network issue) causes empty stdout to flow into scan, which then exits 0 — the guard reports "clean" when it has actually scanned nothing. A suggested fix is provided on those lines.

No other blocking issues found in the remaining files (.gitignore, AGENTS.md, .agents/rules/git/oss-isolation.md).


You can now have the agent implement changes and create commits directly on your pull request's source branch. Simply comment with /q followed by your request in natural language to ask the agent to make changes.

Comment thread scripts/oss-github-guard.sh Resolved
Comment thread scripts/oss-github-guard.sh Resolved
@codacy-production

Copy link
Copy Markdown

Not up to standards ⛔

🔴 Issues 1 medium

Alerts:
⚠ 1 issue (≤ 0 issues of at least minor severity)

Results:
1 new issue

Category Results
ErrorProne 1 medium

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@sourcery-ai sourcery-ai 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.

Hey - I've found 16 issues

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="AGENTS.md" line_range="46-47" />
<code_context>
+`.agents/rules/git/oss-isolation.md`).
+
+Before any `git push` to a public remote or `gh pr create/edit/comment`:
+run `scripts/oss-github-guard.sh` (the pre-push hook enforces this; a
+non-zero exit is a hard stop). Full rule:
+`.agents/rules/git/oss-isolation.md`.
</code_context>
<issue_to_address>
**Pushes bypass the guard**

When a contributor pushes using the repository’s configured Git hooks, no configured `.husky/pre-push` hook invokes `scripts/oss-github-guard.sh`, so ordinary public pushes proceed without the advertised mechanical check and forbidden context reaches GitHub.

Add and configure a pre-push hook that runs `scripts/oss-github-guard.sh`.

Also at `scripts/oss-github-guard.sh:10`.
</issue_to_address>

### Comment 2
<location path="scripts/oss-github-guard.sh" line_range="71" />
<code_context>
+        else
+          range="$remote_sha..$local_sha"
+        fi
+        git log --format='%H%n%B%n%an <%ae>%n%cn <%ce>' "$range" 2>/dev/null | scan "commits $range -> $remote_name (github.com)" || exit 1
+      done
+      echo "OSS-GUARD: push to $remote_name (github.com) clean."
</code_context>
<issue_to_address>
**Pushed file contents go unchecked**

When an outgoing commit contains forbidden context in a changed file, `git log --format` supplies only commit hashes, messages, and author/committer metadata to `scan`, not changed file contents, so forbidden context in source, comments, fixtures, or documentation passes the push check and reaches GitHub.

Scan the outgoing changes’ file contents as well as their commit metadata.

Also at `.agents/rules/git/oss-isolation.md:22`.
</issue_to_address>

### Comment 3
<location path="scripts/oss-github-guard.sh" line_range="45-46" />
<code_context>
+case "${1:-}" in
+  --pr)
+    [ -n "${2:-}" ] || { echo "usage: $0 --pr <N>" >&2; exit 2; }
+    gh pr view "$2" --json title,body --jq '.title, .body' 2>/dev/null | scan "PR $2 title/body" || exit 1
+    gh pr view "$2" --json comments --jq '.comments[] | .body' 2>/dev/null | scan "PR $2 comments" || exit 1
+    echo "OSS-GUARD: PR $2 clean."
+    ;;
</code_context>
<issue_to_address>
**Failed scans report clean**

When `gh`, `git log`, or a file read fails while the guard is running, the pipelines return `scan`’s status, and `scan` accepts empty input as clean; failed `--file` reads also fall through. The guard reports success without inspecting the input, allowing the caller to proceed unchecked.

Make producer and file-read failures stop the guard instead of treating missing input as a clean scan.

Also at `scripts/oss-github-guard.sh:37-38`, `scripts/oss-github-guard.sh:51`, `scripts/oss-github-guard.sh:71`, `scripts/oss-github-guard.sh:79-80`.
</issue_to_address>

### Comment 4
<location path="scripts/oss-github-guard.sh" line_range="46" />
<code_context>
+  --pr)
+    [ -n "${2:-}" ] || { echo "usage: $0 --pr <N>" >&2; exit 2; }
+    gh pr view "$2" --json title,body --jq '.title, .body' 2>/dev/null | scan "PR $2 title/body" || exit 1
+    gh pr view "$2" --json comments --jq '.comments[] | .body' 2>/dev/null | scan "PR $2 comments" || exit 1
+    echo "OSS-GUARD: PR $2 clean."
+    ;;
</code_context>
<issue_to_address>
**Review replies go unchecked**

When forbidden context appears in a PR review comment or reply, the `--pr` query reads general PR comments but not review threads or inline review replies, so `scan` reports the PR clean while that public text remains unchecked.

Include review-thread comments and replies in the `--pr` scan.

Also at `.agents/rules/git/oss-isolation.md:17`.
</issue_to_address>

### Comment 5
<location path="scripts/oss-github-guard.sh" line_range="42-46" />
<code_context>
+  fi
+}
+
+case "${1:-}" in
+  --pr)
+    [ -n "${2:-}" ] || { echo "usage: $0 --pr <N>" >&2; exit 2; }
+    gh pr view "$2" --json title,body --jq '.title, .body' 2>/dev/null | scan "PR $2 title/body" || exit 1
+    gh pr view "$2" --json comments --jq '.comments[] | .body' 2>/dev/null | scan "PR $2 comments" || exit 1
+    echo "OSS-GUARD: PR $2 clean."
+    ;;
</code_context>
<issue_to_address>
**Issue text goes unchecked**

When a contributor creates or edits an issue containing forbidden context, the guard has no issue mode and `--pr` only queries pull requests, so issue titles, bodies, and comments are not checked by the advertised live-content scan.

Add a guard mode that scans the relevant issue text before it is published.

Also at `.agents/rules/git/oss-isolation.md:48`.
</issue_to_address>

### Comment 6
<location path="scripts/oss-github-guard.sh" line_range="45-46" />
<code_context>
+case "${1:-}" in
+  --pr)
+    [ -n "${2:-}" ] || { echo "usage: $0 --pr <N>" >&2; exit 2; }
+    gh pr view "$2" --json title,body --jq '.title, .body' 2>/dev/null | scan "PR $2 title/body" || exit 1
+    gh pr view "$2" --json comments --jq '.comments[] | .body' 2>/dev/null | scan "PR $2 comments" || exit 1
+    echo "OSS-GUARD: PR $2 clean."
+    ;;
</code_context>
<issue_to_address>
**New GitHub text goes unchecked**

When a contributor submits a new PR or issue title, body, or comment, the documented preflight scans branch names and commit metadata, while `--pr` reads an existing PR rather than the text about to be submitted; the new payload can therefore reach GitHub without being checked.

Scan the proposed GitHub text itself as part of the preflight.

Also at `.agents/rules/git/oss-isolation.md:48`.
</issue_to_address>

### Comment 7
<location path="scripts/oss-github-guard.sh" line_range="18-23" />
<code_context>
+# live in scripts/.oss-guard-local.patterns (local, untracked): one regex
+# fragment per line, OR-joined into the scan. Without that file only the
+# generic patterns apply.
+PATTERNS='@(corp|internal)\.example'
+LABEL='internal / non-public context'
+PATTERN_FILE="$(dirname "$0")/.oss-guard-local.patterns"
+if [ -f "$PATTERN_FILE" ]; then
+  LOCAL=$(grep -vE '^\s*(#|$)' "$PATTERN_FILE" | paste -sd '|' -)
+  [ -n "$LOCAL" ] && PATTERNS="$PATTERNS|$LOCAL"
+fi
+TMP=$(mktemp) || exit 2
</code_context>
<issue_to_address>
**Local patterns are silently omitted**

When the ignored local pattern file has not been provisioned, `scripts/oss-github-guard.sh` continues with only its generic pattern and reports a clean scan, so organization-specific links, codenames, and identifiers go undetected.

Require the local pattern file or otherwise ensure the required organization-specific patterns are available before scanning.
</issue_to_address>

### Comment 8
<location path="scripts/oss-github-guard.sh" line_range="59-61" />
<code_context>
+      # pre-push hook mode: args "<remote> <url>", stdin lines "<local_ref> <local_sha> <remote_ref> <remote_sha>"
+      remote_name="$1"; remote_url="$2"
+      case "$remote_url" in
+        *github.com*) : ;;
+        *) exit 0 ;;  # internal remotes (GitLab) are out of scope for this guard
+      esac
+      while read -r local_ref local_sha remote_ref remote_sha; do
+        [ "$local_sha" = "0000000000000000000000000000000000000000" ] && continue
</code_context>
<issue_to_address>
**SSH aliases bypass scanning**

When a public GitHub remote uses an SSH host alias, the remote URL does not contain the literal `github.com`, so the `case` check exits as though the remote were internal and skips the push scan.

Recognize GitHub remotes configured through SSH host aliases.
</issue_to_address>

### Comment 9
<location path="scripts/oss-github-guard.sh" line_range="67" />
<code_context>
+        branch=${local_ref#refs/heads/}
+        printf '%s\n' "$branch" | scan "branch name ($branch)" || exit 1
+        if [ "$remote_sha" = "0000000000000000000000000000000000000000" ]; then
+          range="$local_sha"
+        else
+          range="$remote_sha..$local_sha"
</code_context>
<issue_to_address>
**Old commits block new branches**

When a new branch descends from already-published commits containing a forbidden pattern, the zero-remote-SHA case sets `range` to the local tip, so `git log` scans its ancestors, including already-published commits; a matching old commit blocks an otherwise clean push.

For a new branch, limit the scan to commits not already reachable from the remote.
</issue_to_address>

### Comment 10
<location path="scripts/oss-github-guard.sh" line_range="79-80" />
<code_context>
+    # standalone mode: scan branch name + commits between upstream and HEAD.
+    branch=$(git rev-parse --abbrev-ref HEAD)
+    printf '%s\n' "$branch" | scan "branch name" || exit 1
+    base=$(git rev-parse --abbrev-ref --symbolic-full-name '@{push}' 2>/dev/null | sed 's|/[^/]*$||') || base=origin
+    git log --format='%H%n%B%n%an <%ae>%n%cn <%ce>' "${base}/HEAD..HEAD" 2>/dev/null | scan "commit metadata (${base}/HEAD..HEAD)" || exit 1
+    echo "OSS-GUARD: outgoing commits and branch name clean."
+    ;;
</code_context>
<issue_to_address>
**Wrong push base is scanned**

When the configured push target differs from the remote’s default branch, standalone mode compares `HEAD` with `remote/HEAD` instead of the configured push target, so it can miss commits the push will send or treat already-published commits as outgoing.

Derive the comparison base from the configured push target rather than the remote’s default branch.
</issue_to_address>

### Comment 11
<location path="scripts/oss-github-guard.sh" line_range="79-80" />
<code_context>
+    # standalone mode: scan branch name + commits between upstream and HEAD.
+    branch=$(git rev-parse --abbrev-ref HEAD)
+    printf '%s\n' "$branch" | scan "branch name" || exit 1
+    base=$(git rev-parse --abbrev-ref --symbolic-full-name '@{push}' 2>/dev/null | sed 's|/[^/]*$||') || base=origin
+    git log --format='%H%n%B%n%an <%ae>%n%cn <%ce>' "${base}/HEAD..HEAD" 2>/dev/null | scan "commit metadata (${base}/HEAD..HEAD)" || exit 1
+    echo "OSS-GUARD: outgoing commits and branch name clean."
+    ;;
</code_context>
<issue_to_address>
**Untracked branches skip commit scans**

When the standalone guard runs on a branch without a configured push upstream, such as before its first push, when `@{push}` is unset, `git rev-parse` fails but the succeeding `sed` makes the command substitution succeed with an empty `base`. The resulting `/HEAD..HEAD` range fails in `git log`, whose error is discarded, so the guard reports clean without scanning commits.

Detect a missing push upstream and either determine the correct outgoing range or exit nonzero instead of reporting clean.
</issue_to_address>

### Comment 12
<location path="scripts/oss-github-guard.sh" line_range="37" />
<code_context>
+
+scan() { # scan <label> — text arrives on stdin, kept in $TMP
+  cat >"$TMP"
+  if grep -Ein "$PATTERNS" "$TMP" >/dev/null 2>&1; then
+    die "$1"
+  fi
</code_context>
<issue_to_address>
**Invalid patterns pass clean**

When a local forbidden-pattern fragment makes the combined regex invalid, if the combined regex is invalid, `grep` returns an error rather than a match; `scan` treats that result as clean and allows the contribution through with the configured checks disabled.

Validate the configured regex before scanning and exit nonzero on grep errors.
</issue_to_address>

### Comment 13
<location path="scripts/oss-github-guard.sh" line_range="18" />
<code_context>
+# live in scripts/.oss-guard-local.patterns (local, untracked): one regex
+# fragment per line, OR-joined into the scan. Without that file only the
+# generic patterns apply.
+PATTERNS='@(corp|internal)\.example'
+LABEL='internal / non-public context'
+PATTERN_FILE="$(dirname "$0")/.oss-guard-local.patterns"
</code_context>
<issue_to_address>
**Corporate emails evade generic scan**

When the local pattern file is absent or does not separately match the email domain, `PATTERNS` is used with `grep -E`, where `@(...)` matches a literal `@` followed by parentheses rather than grouping alternatives. An author such as `name@corp.example` therefore passes the generic email check unless a local pattern independently catches it.

Use ERE grouping without the literal `@` parentheses, for example `@(corp|internal)\.example` should be written as `@(corp|internal)\.example` only if `@` is intended literally before the group; otherwise use `@(corp|internal)`’s equivalent ERE as `@(corp|internal)` is not valid grouping—construct the intended domain pattern with `@(... )` removed as a literal, e.g. `@(corp|internal)` replaced by `@(corp|internal)` is not sufficient.
</issue_to_address>

### Comment 14
<location path=".agents/rules/git/oss-isolation.md" line_range="6" />
<code_context>
+description: Zero internal context in any public GitHub contribution. Mandatory preflight before publishing to github.com.
+---
+
+# OSS Isolation Rule (public GitHub)
+
+## The rule
</code_context>
<issue_to_address>
**New rule is missing from the rules index**

When this new agent rule is added without updating the repository guide's rules index, the repository guide's rules index omits the new OSS isolation rule, so agents relying on that index cannot discover it there.

Add the OSS isolation rule to the rules index in `.agents/repo-guide.md`.
</issue_to_address>

### Comment 15
<location path="scripts/oss-github-guard.sh" line_range="71" />
<code_context>
+        else
+          range="$remote_sha..$local_sha"
+        fi
+        git log --format='%H%n%B%n%an <%ae>%n%cn <%ce>' "$range" 2>/dev/null | scan "commits $range -> $remote_name (github.com)" || exit 1
+      done
+      echo "OSS-GUARD: push to $remote_name (github.com) clean."
</code_context>
<issue_to_address>
**Annotated tag text goes unchecked**

When a pushed annotated tag contains forbidden text in its annotation or tagger metadata, `git log` dereferences the tag to its target commit, so the tag annotation and tagger metadata are not scanned and can be published unchecked.

Scan the pushed annotated tag object, including its annotation and tagger metadata.
</issue_to_address>

### Comment 16
<location path="scripts/oss-github-guard.sh" line_range="59-60" />
<code_context>
+      # pre-push hook mode: args "<remote> <url>", stdin lines "<local_ref> <local_sha> <remote_ref> <remote_sha>"
+      remote_name="$1"; remote_url="$2"
+      case "$remote_url" in
+        *github.com*) : ;;
+        *) exit 0 ;;  # internal remotes (GitLab) are out of scope for this guard
+      esac
+      while read -r local_ref local_sha remote_ref remote_sha; do
</code_context>
<issue_to_address>
**Uppercase hostnames bypass scanning**

When a GitHub remote URL uses uppercase letters in its hostname, the case-sensitive `case` pattern does not match the GitHub URL, so the script exits as though the remote were internal and skips the push scan.

Normalize the hostname’s case or use a case-insensitive GitHub URL check.
</issue_to_address>

Sourcery assessment

Approval pending. 16 findings to address first.

Blocking findings: AGENTS.md:47, scripts/oss-github-guard.sh:71, scripts/oss-github-guard.sh:46, scripts/oss-github-guard.sh:46, scripts/oss-github-guard.sh:46, and 11 more


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Comment thread AGENTS.md Resolved
Comment thread scripts/oss-github-guard.sh Resolved
Comment thread scripts/oss-github-guard.sh Resolved
Comment thread scripts/oss-github-guard.sh Resolved
Comment thread scripts/oss-github-guard.sh Resolved
Comment thread scripts/oss-github-guard.sh Resolved
Comment thread scripts/oss-github-guard.sh Resolved
Comment thread .agents/rules/git/oss-isolation.md Resolved
Comment thread scripts/oss-github-guard.sh Resolved
Comment thread scripts/oss-github-guard.sh Resolved
Add an always-on agent rule (.agents/rules/git/oss-isolation.md) and
scripts/oss-github-guard.sh: a mechanical gate that scans outgoing commit
metadata, branch names and PR/issue text before anything reaches a public
remote. Organization-specific forbidden patterns live in
scripts/.oss-guard-local.patterns (local, untracked) so the published
script ships only the mechanism; the pre-push hook OR-joins them into the
scan. AGENTS.md gains a mandatory pointer section.
@kody-ai

kody-ai Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Kody Review Complete

Great news! 🎉
No issues were found that match your current review configurations.

Keep up the excellent work! 🚀

Kody Guide: Usage and Configuration
Interacting with Kody
  • Request a Review: Ask Kody to review your PR manually by adding a comment with the @kody start-review command at the root of your PR.

  • Validate Business Logic: Ask Kody to validate your code against business rules by adding a comment with the @kody -v business-logic command.

  • Provide Feedback: Help Kody learn and improve by reacting to its comments with a 👍 for helpful suggestions or a 👎 if improvements are needed.

Current Kody Configuration
Review Options

The following review options are enabled or disabled:

Options Enabled
Bug ✅
Performance ✅
Security ✅
Business Logic ✅

Access your configuration settings here.

​

Comment thread .agents/rules/git/oss-isolation.md Resolved
Comment thread AGENTS.md Resolved
Comment thread scripts/oss-github-guard.sh Resolved
Comment thread scripts/oss-github-guard.sh Resolved
Comment thread scripts/oss-github-guard.sh Resolved
@codeant-ai

codeant-ai Bot commented Nov 20, 2026

Copy link
Copy Markdown

CodeAnt  CodeAnt PR Risk

🔴  High Risk

  • The PR should not merge yet because its central publishing guard can silently miss sensitive content.
  • No tracked hook invokes the guard on ordinary pushes, despite AGENTS.md saying the pre-push hook enforces it.
  • The guard lacks issue scanning and its PR mode omits review replies, leaving channels named in the rule unchecked.
  • Fresh clones lack the ignored organization-specific pattern file, so the guard checks only the generic email pattern.
  • Without a push upstream, standalone mode can pass an invalid git log range and report a clean scan.

Assessed commit: 8837db3c196d

@sonarqubecloud

Copy link
Copy Markdown

@ThePlenkov
ThePlenkov merged commit cb6705f into main Nov 20, 2026
22 of 25 checks passed
@ThePlenkov
ThePlenkov deleted the chore/oss-guard branch November 20, 2026 13:18
ThePlenkov added a commit that referenced this pull request Nov 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:L This PR changes 100-499 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant