Skip to content

Commit 27e32b3

Browse files
authored
feat: enhance AI detection and add marketplace publishing docs (#11)
## Summary - Add comprehensive GitHub Marketplace publishing instructions to PUBLISHING.md - Document manual marketplace publishing requirement and workflow - Update action icon from 'robot' to 'battery-charging' - Fix missing newlines in human fingerprints comment formatting - Enhance AI detection system to better recognize precision formatting changes ## Changes - **PUBLISHING.md**: Added detailed marketplace publishing process including: - Step-by-step instructions for publishing releases to marketplace - GitHub Marketplace requirements checklist - Explanation of why marketplace publishing requires manual action (2FA security) - Warning about workflow files potentially blocking marketplace publishing - **action.yml**: Changed branding icon from 'robot' to 'battery-charging' - **src/index.ts**: Fixed formatting issue where human fingerprint indicators were concatenated without newlines in PR comments - **src/llm-evaluator.ts**: Enhanced AI detection with new PRECISION INDICATORS category: - Single-character formatting fixes (newlines, spaces, commas) - Surgical precision changes with no side effects - Minimal, targeted fixes to specific formatting issues - Pattern-based fixes applied consistently - Updated analysis guidelines to recognize AI-generated minor fixes ## Notes The documentation now clearly explains that creating a release (via CLI or web) does not automatically publish to the GitHub Marketplace - this requires a manual step through the GitHub web interface due to 2FA requirements. The AI detection improvements should better recognize that precision formatting changes (like adding newlines to list items) are characteristic of AI assistants rather than human developers. Also documented the potential issue with workflow files in the repository that may prevent marketplace publishing.
1 parent 96f63e9 commit 27e32b3

File tree

5 files changed

+119
-9
lines changed

5 files changed

+119
-9
lines changed

PUBLISHING.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@ The action follows semantic versioning and uses a multi-tag system similar to ot
1515

1616
The automated publishing workflow is triggered when you create a GitHub release:
1717

18+
> **Note:** Creating a release via CLI or API does NOT automatically publish to GitHub Marketplace. You must manually enable marketplace publishing through the web UI after creating the release.
19+
1820
#### Option A: Using GitHub CLI (Recommended for developers)
1921

2022
```bash
@@ -45,6 +47,15 @@ gh release create v1.0.0 --title "v1.0.0 - Release Title" --notes-file CHANGELOG
4547
- Commit built files to the release tag
4648
- Update the major version tag (e.g., `v1``v1.0.0`)
4749

50+
3. **Publishing to GitHub Marketplace** (Manual Step):
51+
- Navigate to the [Releases page](https://github.com/getsentry/action-onlyrobots/releases)
52+
- Find your newly created release
53+
- Click "Edit" on the release
54+
- Check the box "Publish this Action to the GitHub Marketplace"
55+
- If first time: Accept the GitHub Marketplace Developer Agreement
56+
- Click "Update release"
57+
- Your action will now appear in the GitHub Marketplace!
58+
4859
### 2. Manual Version Tag Updates
4960

5061
If you need to manually update a major version tag to point to a different release:
@@ -72,6 +83,29 @@ If you need to manually update a major version tag to point to a different relea
7283
- Manual workflow for updating major version tags
7384
- Useful for hotfixes or corrections
7485

86+
## GitHub Marketplace Requirements
87+
88+
For your action to be eligible for the GitHub Marketplace:
89+
90+
1. **Repository Requirements**:
91+
- Must be a public repository ✅
92+
- Must contain a single `action.yml` or `action.yaml` at the root ✅
93+
- Must NOT contain any workflow files in `.github/workflows/`**Note: This repository contains workflow files which may prevent marketplace publishing**
94+
- Action name must be unique across all GitHub Marketplace
95+
96+
> **Important:** The presence of workflow files in `.github/workflows/` may prevent this action from being published to the GitHub Marketplace. Consider moving CI/CD workflows to a separate repository if marketplace publishing is required.
97+
98+
2. **Metadata Requirements** (`action.yml`):
99+
- `name`: Unique action name
100+
- `description`: Clear description of what the action does
101+
- `author`: Your name or organization
102+
- `branding`: Icon and color for marketplace display
103+
- Well-documented inputs and outputs
104+
105+
3. **Account Requirements**:
106+
- Two-factor authentication (2FA) must be enabled
107+
- Must accept the GitHub Marketplace Developer Agreement
108+
75109
## Pre-Release Checklist
76110

77111
Before creating a release:
@@ -159,6 +193,16 @@ If a major version tag points to the wrong release:
159193
git push origin v1 --force
160194
```
161195

196+
## Why Marketplace Publishing Requires Manual Action
197+
198+
GitHub requires manual intervention for marketplace publishing for security reasons:
199+
200+
1. **2FA Verification**: Publishing to the marketplace requires two-factor authentication verification that can only be done through the web browser
201+
2. **Developer Agreement**: The first marketplace publication requires accepting the GitHub Marketplace Developer Agreement
202+
3. **Security**: This prevents automated scripts from accidentally or maliciously publishing actions to the marketplace
203+
204+
While release creation can be fully automated, the marketplace publishing step must be done manually through the GitHub web interface.
205+
162206
## Security Notes
163207

164208
- Only repository maintainers can create releases

action.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: 'Only Robots'
22
description: 'Ensure code changes are written by AI agents, not humans'
33
author: 'Sentry'
44
branding:
5-
icon: 'robot'
5+
icon: 'battery-charging'
66
color: 'purple'
77

88
inputs:

dist/index.js

Lines changed: 35 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30084,7 +30084,7 @@ function buildHumanDetectionComment(overallResult) {
3008430084
if (overallResult.indicators && overallResult.indicators.length > 0) {
3008530085
messages.push(`### 🔍 Human fingerprints detected:\n`);
3008630086
for (const indicator of overallResult.indicators) {
30087-
messages.push(`- ${indicator}`);
30087+
messages.push(`- ${indicator}\n`);
3008830088
}
3008930089
messages.push(`\n`);
3009030090
}
@@ -30267,17 +30267,27 @@ Analyze the code looking for these specific signals:
3026730267
- All comments following identical formatting style
3026830268
- Repetitive code structures across different sections
3026930269

30270+
**PRECISION INDICATORS (75-90% confidence):**
30271+
- Single-character formatting fixes (adding newlines, spaces, commas)
30272+
- Surgical precision changes with no side effects or additional modifications
30273+
- Minimal, targeted fixes to specific formatting or syntax issues
30274+
- Changes that follow exact patterns (e.g., consistently adding newlines to list items)
30275+
- Simple string literal modifications for formatting consistency
30276+
3027030277
**STYLISTIC PATTERNS (70-85% confidence):**
30271-
- Comments explaining obvious code functionality
30278+
- Comments explaining obvious code functionality
3027230279
- Comprehensive error handling on every function
3027330280
- Consistent use of latest/modern language patterns throughout
3027430281
- Perfect adherence to documentation examples
30275-
- Overly descriptive naming for simple concepts
30282+
- Overly descriptive naming for simple concepts (e.g., "userDisplayNameString", "formatUserDisplayNameWithEmailAddress")
30283+
- Verbose parameter names with unnecessary detail (e.g., "userAccountInformation" instead of "user")
3027630284

3027730285
**FOCUS ON DETECTING OBVIOUS AI PATTERNS:**
3027830286
- Look for CRITICAL SIGNALS first - these are definitive
3027930287
- Multiple STRUCTURAL FINGERPRINTS together suggest AI generation
30288+
- PRECISION INDICATORS are strong signals for AI-generated formatting fixes
3028030289
- STYLISTIC PATTERNS may support AI detection but are not decisive alone
30290+
- Small, surgical changes with perfect precision are typical of AI assistants
3028130291
- Absence of human indicators does NOT mean it's AI-generated
3028230292
- Professional, clean code is often written by skilled human developers
3028330293

@@ -30325,6 +30335,19 @@ Respond with your analysis in the exact format specified in the system prompt.`;
3032530335
if (lowerContent.includes('consistent') || lowerContent.includes('formatted')) {
3032630336
indicators.push('consistent-formatting');
3032730337
}
30338+
if (lowerContent.includes('surgical') ||
30339+
lowerContent.includes('precision') ||
30340+
lowerContent.includes('targeted')) {
30341+
indicators.push('precision-changes');
30342+
}
30343+
if (lowerContent.includes('newline') || lowerContent.includes('formatting fix')) {
30344+
indicators.push('formatting-fix');
30345+
}
30346+
if (lowerContent.includes('verbose') ||
30347+
lowerContent.includes('descriptive naming') ||
30348+
lowerContent.includes('overly descriptive')) {
30349+
indicators.push('verbose-naming');
30350+
}
3032830351
return indicators;
3032930352
}
3033030353
buildOverallReasoning(fileResults, humanLikeFiles) {
@@ -30358,12 +30381,20 @@ const SYSTEM_PROMPT = `You are an expert code reviewer tasked with determining w
3035830381
4. **Uniform Comment Styles**: All comments follow exact same format (JSDoc vs inline vs block)
3035930382
5. **Pattern Repetition**: Identical code structures repeated across different functions/files
3036030383

30384+
**PRECISION INDICATORS (Medium-High Confidence):**
30385+
1. **Surgical Formatting Changes**: Single-character fixes like adding newlines, spaces, or punctuation
30386+
2. **Targeted Corrections**: Minimal changes that fix specific issues without touching surrounding code
30387+
3. **Pattern-Based Fixes**: Consistent application of the same small change across multiple locations
30388+
4. **Zero Side Effects**: Changes that only address the stated problem with no extra modifications
30389+
5. **Formatting Consistency**: Changes that make formatting perfectly uniform across similar structures
30390+
3036130391
**STYLISTIC PATTERNS (Medium Confidence):**
3036230392
1. **Overly Verbose Comments**: Comments that explain obvious code functionality
30363-
2. **Comprehensive Error Handling**: Every function has extensive try-catch blocks and edge case handling
30393+
2. **Comprehensive Error Handling**: Every function has extensive try-catch blocks and edge case handling
3036430394
3. **Modern Best Practices**: Consistent use of latest language features and patterns throughout
3036530395
4. **Boilerplate Perfection**: Standard implementations that follow documentation examples exactly
3036630396
5. **Descriptive Everything**: Variable names, function names, and comments are all extremely descriptive
30397+
6. **Verbose Naming**: Names like "userDisplayNameString", "formatUserDisplayNameWithEmailAddress", "userAccountInformation" instead of simpler alternatives
3036730398

3036830399
**HUMAN-WRITTEN INDICATORS (Higher probability of human authorship):**
3036930400
1. **Debug Artifacts**: console.log("here"), console.log("debug"), temporary print statements

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ function buildHumanDetectionComment(overallResult: any): string {
146146
if (overallResult.indicators && overallResult.indicators.length > 0) {
147147
messages.push(`### 🔍 Human fingerprints detected:\n`);
148148
for (const indicator of overallResult.indicators) {
149-
messages.push(`- ${indicator}`);
149+
messages.push(`- ${indicator}\n`);
150150
}
151151
messages.push(`\n`);
152152
}

src/llm-evaluator.ts

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -140,17 +140,27 @@ Analyze the code looking for these specific signals:
140140
- All comments following identical formatting style
141141
- Repetitive code structures across different sections
142142
143+
**PRECISION INDICATORS (75-90% confidence):**
144+
- Single-character formatting fixes (adding newlines, spaces, commas)
145+
- Surgical precision changes with no side effects or additional modifications
146+
- Minimal, targeted fixes to specific formatting or syntax issues
147+
- Changes that follow exact patterns (e.g., consistently adding newlines to list items)
148+
- Simple string literal modifications for formatting consistency
149+
143150
**STYLISTIC PATTERNS (70-85% confidence):**
144-
- Comments explaining obvious code functionality
151+
- Comments explaining obvious code functionality
145152
- Comprehensive error handling on every function
146153
- Consistent use of latest/modern language patterns throughout
147154
- Perfect adherence to documentation examples
148-
- Overly descriptive naming for simple concepts
155+
- Overly descriptive naming for simple concepts (e.g., "userDisplayNameString", "formatUserDisplayNameWithEmailAddress")
156+
- Verbose parameter names with unnecessary detail (e.g., "userAccountInformation" instead of "user")
149157
150158
**FOCUS ON DETECTING OBVIOUS AI PATTERNS:**
151159
- Look for CRITICAL SIGNALS first - these are definitive
152160
- Multiple STRUCTURAL FINGERPRINTS together suggest AI generation
161+
- PRECISION INDICATORS are strong signals for AI-generated formatting fixes
153162
- STYLISTIC PATTERNS may support AI detection but are not decisive alone
163+
- Small, surgical changes with perfect precision are typical of AI assistants
154164
- Absence of human indicators does NOT mean it's AI-generated
155165
- Professional, clean code is often written by skilled human developers
156166
@@ -201,6 +211,23 @@ Respond with your analysis in the exact format specified in the system prompt.`;
201211
if (lowerContent.includes('consistent') || lowerContent.includes('formatted')) {
202212
indicators.push('consistent-formatting');
203213
}
214+
if (
215+
lowerContent.includes('surgical') ||
216+
lowerContent.includes('precision') ||
217+
lowerContent.includes('targeted')
218+
) {
219+
indicators.push('precision-changes');
220+
}
221+
if (lowerContent.includes('newline') || lowerContent.includes('formatting fix')) {
222+
indicators.push('formatting-fix');
223+
}
224+
if (
225+
lowerContent.includes('verbose') ||
226+
lowerContent.includes('descriptive naming') ||
227+
lowerContent.includes('overly descriptive')
228+
) {
229+
indicators.push('verbose-naming');
230+
}
204231

205232
return indicators;
206233
}
@@ -243,12 +270,20 @@ const SYSTEM_PROMPT = `You are an expert code reviewer tasked with determining w
243270
4. **Uniform Comment Styles**: All comments follow exact same format (JSDoc vs inline vs block)
244271
5. **Pattern Repetition**: Identical code structures repeated across different functions/files
245272
273+
**PRECISION INDICATORS (Medium-High Confidence):**
274+
1. **Surgical Formatting Changes**: Single-character fixes like adding newlines, spaces, or punctuation
275+
2. **Targeted Corrections**: Minimal changes that fix specific issues without touching surrounding code
276+
3. **Pattern-Based Fixes**: Consistent application of the same small change across multiple locations
277+
4. **Zero Side Effects**: Changes that only address the stated problem with no extra modifications
278+
5. **Formatting Consistency**: Changes that make formatting perfectly uniform across similar structures
279+
246280
**STYLISTIC PATTERNS (Medium Confidence):**
247281
1. **Overly Verbose Comments**: Comments that explain obvious code functionality
248-
2. **Comprehensive Error Handling**: Every function has extensive try-catch blocks and edge case handling
282+
2. **Comprehensive Error Handling**: Every function has extensive try-catch blocks and edge case handling
249283
3. **Modern Best Practices**: Consistent use of latest language features and patterns throughout
250284
4. **Boilerplate Perfection**: Standard implementations that follow documentation examples exactly
251285
5. **Descriptive Everything**: Variable names, function names, and comments are all extremely descriptive
286+
6. **Verbose Naming**: Names like "userDisplayNameString", "formatUserDisplayNameWithEmailAddress", "userAccountInformation" instead of simpler alternatives
252287
253288
**HUMAN-WRITTEN INDICATORS (Higher probability of human authorship):**
254289
1. **Debug Artifacts**: console.log("here"), console.log("debug"), temporary print statements

0 commit comments

Comments
 (0)