Skip to content

t1032.6: Add audit trend tracking#1378

Merged
marcusquinn merged 5 commits intomainfrom
feature/t1032.6
Feb 13, 2026
Merged

t1032.6: Add audit trend tracking#1378
marcusquinn merged 5 commits intomainfrom
feature/t1032.6

Conversation

@marcusquinn
Copy link
Owner

@marcusquinn marcusquinn commented Feb 13, 2026

Summary

Implements audit trend tracking for the code audit system with the following features:

1. Audit Snapshots Table

  • Created audit_snapshots table in the audit SQLite DB
  • Records per-run totals: date, source, total_findings, by_severity (critical/high/medium/low), false_positives, tasks_created
  • Automatic schema migration on first run

2. Snapshot Recording

  • code-audit-helper.sh snapshot <source> command to record audit run results
  • Supports all severity levels and metadata
  • Example: code-audit-helper.sh snapshot sonarcloud --total 42 --critical 2 --high 5 --medium 15 --low 20

3. Trend Analysis

  • code-audit-helper.sh trend [--source <src>] command shows week-over-week and month-over-month deltas
  • Displays current state and historical comparisons
  • Supports filtering by source (sonarcloud, codacy, coderabbit, etc.)

4. Regression Detection

  • code-audit-helper.sh check-regression detects >20% increases in findings
  • Checks total findings, critical, and high severity separately
  • Integrated into supervisor pulse as Phase 10c
  • Warnings logged to pulse log when regressions detected

5. Supervisor Integration

  • Added Phase 10c to supervisor pulse cycle
  • Runs regression check automatically every pulse
  • Logs warnings when audit quality degrades

Testing

Verified:

  • ✅ Database schema creation and migration
  • ✅ Snapshot recording with multiple sources
  • ✅ Trend calculation (WoW/MoM deltas)
  • ✅ Regression detection (30%, 50%, 60% increases detected correctly)
  • ✅ ShellCheck passes with zero violations
  • ✅ Multi-source support (sonarcloud, codacy tested)

Usage Examples

# Initialize database
code-audit-helper.sh init

# Record snapshot after audit run
code-audit-helper.sh snapshot sonarcloud --total 42 --critical 2 --high 5 --medium 15 --low 20

# View trends
code-audit-helper.sh trend --source sonarcloud

# Check for regressions
code-audit-helper.sh check-regression

Integration

The supervisor pulse automatically runs regression checks in Phase 10c. No manual intervention needed once snapshots are being recorded.

Ref #1368

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 13, 2026

Warning

Rate limit exceeded

@marcusquinn has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 11 minutes and 47 seconds before requesting another review.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/t1032.6

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

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

@github-actions
Copy link

🔍 Code Quality Report

�[0;35m[MONITOR]�[0m Code Review Monitoring Report

�[0;34m[INFO]�[0m Latest Quality Status:
SonarCloud: 0 bugs, 0 vulnerabilities, 19 code smells

�[0;34m[INFO]�[0m Recent monitoring activity:
Fri Feb 13 15:02:56 UTC 2026: Code review monitoring started
Fri Feb 13 15:02:57 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 19

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 19
  • VULNERABILITIES: 0

Generated on: Fri Feb 13 15:03:00 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

@github-actions
Copy link

🔍 Code Quality Report

�[0;35m[MONITOR]�[0m Code Review Monitoring Report

�[0;34m[INFO]�[0m Latest Quality Status:
SonarCloud: 0 bugs, 0 vulnerabilities, 19 code smells

�[0;34m[INFO]�[0m Recent monitoring activity:
Fri Feb 13 15:03:53 UTC 2026: Code review monitoring started
Fri Feb 13 15:03:54 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 19

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 19
  • VULNERABILITIES: 0

Generated on: Fri Feb 13 15:03:56 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

@marcusquinn marcusquinn marked this pull request as ready for review February 13, 2026 15:05
@gemini-code-assist
Copy link

Summary of Changes

Hello @marcusquinn, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request introduces a robust system for tracking code audit findings over time and automatically detecting regressions. By adding a dedicated helper script and integrating its functionality into the existing supervisor, the system can now maintain historical audit data, analyze trends, and proactively alert on significant increases in issues, thereby enhancing code quality and security monitoring.

Highlights

  • New Audit Helper Script: Introduced a new shell script, .agents/scripts/code-audit-helper.sh, designed for tracking code audit trends and detecting regressions. This script utilizes an SQLite database to store audit snapshots.
  • Audit Data Management: The code-audit-helper.sh script provides commands to initialize the audit database, record detailed snapshots of audit findings (including total, critical, high, medium, low, false positives, and tasks created), and display week-over-week and month-over-month trends.
  • Regression Detection: Implemented a check-regression command within the audit helper script that identifies significant increases (>20%) in total, critical, or high-severity findings between consecutive audit snapshots, signaling potential regressions.
  • Supervisor Integration: Integrated the audit regression detection into the pulse.sh supervisor script as 'Phase 10c', ensuring that regression checks are performed regularly and warnings are logged if detected.
Changelog
  • .agents/scripts/code-audit-helper.sh
    • Added a new shell script to manage code audit snapshots and trend analysis.
    • Implemented commands for database initialization, recording audit findings, displaying trends, and checking for regressions.
    • Utilized SQLite for persistent storage of audit data.
  • .agents/scripts/supervisor/pulse.sh
    • Removed an extra blank line.
    • Integrated a new 'Phase 10c' to execute the audit regression detection from code-audit-helper.sh.
    • Added logging for audit regression checks and warnings for detected regressions.
Activity
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@github-actions
Copy link

🔍 Code Quality Report

�[0;35m[MONITOR]�[0m Code Review Monitoring Report

�[0;34m[INFO]�[0m Latest Quality Status:
SonarCloud: 0 bugs, 0 vulnerabilities, 19 code smells

�[0;34m[INFO]�[0m Recent monitoring activity:
Fri Feb 13 15:05:30 UTC 2026: Code review monitoring started
Fri Feb 13 15:05:30 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 19

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 19
  • VULNERABILITIES: 0

Generated on: Fri Feb 13 15:05:33 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a new code-audit-helper.sh script for tracking audit trends and detecting regressions, which is a valuable addition. However, the new script has several issues that need to be addressed. There are critical SQL injection vulnerabilities that must be fixed. Additionally, there are robustness issues with handling command outputs that could cause script failures, and several violations of the repository's shell scripting style guide regarding database settings and function structure. My review provides specific suggestions to resolve these problems.

@github-actions
Copy link

🔍 Code Quality Report

�[0;35m[MONITOR]�[0m Code Review Monitoring Report

�[0;34m[INFO]�[0m Latest Quality Status:
SonarCloud: 0 bugs, 0 vulnerabilities, 19 code smells

�[0;34m[INFO]�[0m Recent monitoring activity:
Fri Feb 13 15:11:22 UTC 2026: Code review monitoring started
Fri Feb 13 15:11:23 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 19

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 19
  • VULNERABILITIES: 0

Generated on: Fri Feb 13 15:11:25 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

- Add SQL injection protection by escaping single quotes in source variable
- Add WAL mode and busy_timeout=5000 to SQLite database initialization
- Initialize variables to default values before read commands to prevent failures
- Add explicit return statements to all functions per style guide
@github-actions
Copy link

🔍 Code Quality Report

�[0;35m[MONITOR]�[0m Code Review Monitoring Report

�[0;34m[INFO]�[0m Latest Quality Status:
SonarCloud: 0 bugs, 0 vulnerabilities, 21 code smells

�[0;34m[INFO]�[0m Recent monitoring activity:
Fri Feb 13 15:38:39 UTC 2026: Code review monitoring started
Fri Feb 13 15:38:39 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 21

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 21
  • VULNERABILITIES: 0

Generated on: Fri Feb 13 15:38:42 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

@sonarqubecloud
Copy link

@marcusquinn marcusquinn merged commit 3e25491 into main Feb 13, 2026
19 checks passed
@marcusquinn marcusquinn deleted the feature/t1032.6 branch February 13, 2026 15:50
marcusquinn added a commit that referenced this pull request Feb 13, 2026
Comprehensive test script (tests/test-audit-e2e.sh) that exercises all 7
checkpoints of the unified audit cycle:

1. Service polling — verifies collectors exist for all 4 services
2. Unified DB — seeds test findings, validates schema and dedup
3. Task creation — verifies finding-to-task pipeline with correct IDs
4. Phase 10b — validates TODO.md append, cooldown, commit/push
5. Phase 0 — confirms auto-dispatch pickup and dispatch wiring
6. Worker PRs — validates dispatch/evaluate infrastructure
7. Trend tracking — tests audit_snapshots table and WoW deltas

Results: 42 pass, 0 fail, 10 skip (all skips due to unmerged deps).
Documents 10 gaps, all traceable to 3 open PRs (#1376, #1377, #1378).

Decision: Treat stub code-audit-helper.sh as skip not fail since the
implementation exists in PR #1376 — matches existing codebase patterns.
marcusquinn added a commit that referenced this pull request Feb 13, 2026
Comprehensive test script (tests/test-audit-e2e.sh) that exercises all 7
checkpoints of the unified audit cycle:

1. Service polling — verifies collectors exist for all 4 services
2. Unified DB — seeds test findings, validates schema and dedup
3. Task creation — verifies finding-to-task pipeline with correct IDs
4. Phase 10b — validates TODO.md append, cooldown, commit/push
5. Phase 0 — confirms auto-dispatch pickup and dispatch wiring
6. Worker PRs — validates dispatch/evaluate infrastructure
7. Trend tracking — tests audit_snapshots table and WoW deltas

Results: 42 pass, 0 fail, 10 skip (all skips due to unmerged deps).
Documents 10 gaps, all traceable to 3 open PRs (#1376, #1377, #1378).

Decision: Treat stub code-audit-helper.sh as skip not fail since the
implementation exists in PR #1376 — matches existing codebase patterns.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

code-reviews-actioned All review feedback has been actioned

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant