-
Notifications
You must be signed in to change notification settings - Fork 9
Add scoring doc, update readme #83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
omkar-foss
wants to merge
2
commits into
chaoss:main
Choose a base branch
from
omkar-foss:update-readme
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+136
−16
Open
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,110 @@ | ||
| # Disclosure numeric scoring (20th May 2026) | ||
|
|
||
| Related issue: https://github.com/chaoss/disclosure/issues/12 | ||
|
|
||
| ## Simple additive scoring | ||
|
|
||
| We use simple additive scoring per detector to compute the final score. Steps are as follows: | ||
| 1. Every detector produces one or more findings per commit. | ||
| 2. For every commit, the scoring is then grouped per-detector e.g. for commit C if there are two | ||
| findings for detector `trailer`, one with score 35 and another with score 45, then `max()` is used | ||
| to aggregate per detector findings at each commit. So in this case, commit C will have score 45 for | ||
| detector type `trailer`. | ||
| 3. The per detector scores are then adds for each commit to get the score for a particular commit. | ||
| e.g. if commit C gets per detector scores of 75.0 and 85.0 from detectors `trailer` and `toolmention` | ||
| detectors respectively, then the total score for commit C will be 75 + 85 = 160.0 | ||
| 4. Confidence is calculated at commit as well as finding level. It's based on the default confidence | ||
| levels unless user-specified: | ||
| - no confidence has score 0 | ||
| - low confidence for score 1 to 30 | ||
| - medium confidence for score 31 to 70 | ||
| - high confidece for score 71 to 100 | ||
|
|
||
| ### Example (branch feature/sample-commit) | ||
| ```git | ||
| Author: Jon Snow <jon.snow@example.com> | ||
| Date: Sat May 17 11:42:08 2026 +0530 | ||
|
|
||
| feat(auth): add JWT refresh token rotation and session invalidation | ||
|
|
||
| Implemented refresh token rotation for improved session security. | ||
| Users now receive a new refresh token on every refresh request, | ||
| and reused/expired tokens invalidate the session automatically. | ||
|
|
||
| Co-authored-by: Claude <noreply@anthropic.com> | ||
| Assisted-by: Github Copilot | ||
| ``` | ||
|
|
||
| In above commit, scoring will be as follows: | ||
| 1. Trailer - Yes, one Co-Author finding matches known trailer with tool Claude Code (40) and known email (35). Another known Assisted-by finding matches known trailer using tool Github Copilot (75.0) = 75.0 | ||
| 2. Committer - No, committer email address doesn't match known AI bot email addresses = 0.0 | ||
| 3. Branch - No, branch does not have known tools = 0.0 | ||
| 4. Gitnotes - No gitnotes found = 0.0 | ||
| 5. toolmention - Yes, one finding, tool Claude matched = 20.0 | ||
|
|
||
| **Total score: 75 + 0 + 0 + 0 + 20 = 95 pts** | ||
|
|
||
| 95 pts lies in 71 to 100 range, so it falls in confidence level here is **high**. | ||
|
omkar-foss marked this conversation as resolved.
|
||
|
|
||
| ### CLI Output Example | ||
|
|
||
| #### Example 1: disclosure scan | ||
| ```sh | ||
| $ disclosure scan | ||
| Scanned 2 commits, 1 with AI signals | ||
|
|
||
| Tools detected: | ||
| Claude Code: 1 | ||
|
|
||
| Commit abc123def456 (score: 100.0, confidence: high) | ||
| [score: 100.0, confidence: high] Claude Code [Opus 4] (trailer): Co-Authored-By trailer with email noreply@anthropic.com | ||
| ``` | ||
|
|
||
| #### Example 2: disclosure text | ||
|
|
||
| For a file `pr-body.txt` with checkboxes: | ||
| ``` | ||
| Generative AI disclosure | ||
|
|
||
| Please select one option: | ||
|
|
||
| [x] This PR uses AI/LLMs | ||
| [ ] This PR does not use AI/LLMs | ||
|
|
||
| If AI tools were used, please provide details below: | ||
| - What tools were used? Claude | ||
| - How were these tools used? For code review | ||
| - Did you review these outputs before submitting this PR? Yes | ||
| ``` | ||
|
|
||
| When run through `disclosure text`, it produces findings that confirm AI use: | ||
| ```sh | ||
| $ disclosure text --input=pr-body.txt --confidence-levels=low=30,medium=70,high=100 --format=json --enable-checkbox-detection | ||
| { | ||
| "commits": { | ||
| "commits": [ | ||
| ... | ||
| ], | ||
| "summary": { | ||
| "total_commits": 9, | ||
| "ai_commits": 0, | ||
| "tool_counts": {}, | ||
| "by_confidence": {}, | ||
| "per_detector_scores": null | ||
| } | ||
| }, | ||
| "text": { | ||
| "findings": [ | ||
| { | ||
| "detector": "toolmention", | ||
| "tool": "Claude", | ||
| "confidence": "high", | ||
| "score": 95, | ||
| "detail": "checkbox confirms AI was used and text mentions Claude" | ||
| } | ||
| ], | ||
| "score": 95, | ||
| "confidence": "high" | ||
| } | ||
| } | ||
| ``` | ||
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.
Uh oh!
There was an error while loading. Please reload this page.