Skip to content

Autonomous Repository Management & AI Automation - #122

Open
NITISH-R-G wants to merge 4 commits into
mainfrom
ai-repo-automation-8966888486129833830
Open

Autonomous Repository Management & AI Automation#122
NITISH-R-G wants to merge 4 commits into
mainfrom
ai-repo-automation-8966888486129833830

Conversation

@NITISH-R-G

@NITISH-R-G NITISH-R-G commented Jul 21, 2026

Copy link
Copy Markdown
Owner

Implementation of the user's objective to make the repository completely autonomous, self-healing, and self-documenting. Includes AI triaging, AI PR reviews, an AI-powered improvement loop, dependency tracking, automated repo stats generation, and automated architecture diagram generation.


PR created automatically by Jules for task 8966888486129833830 started by @NITISH-R-G

Summary by Sourcery

Introduce AI-driven automation and repository analysis workflows to make the project more autonomous while tightening contributor and agent guidelines.

New Features:

  • Add AI-powered issue triage, pull request review, and continuous improvement workflows using Gemini-based automation scripts.
  • Add automated repository analysis, architecture diagram generation, and knowledge graph creation with outputs stored under docs/architecture.
  • Introduce an npm fix command to combine formatting and lint auto-fix operations.

Enhancements:

  • Increase Dependabot update frequency to daily for npm and GitHub Actions dependencies.
  • Add madge as a development dependency to support automated dependency graph generation.
  • Clarify and align labeling documentation formatting in CONTRIBUTING and add AGENTS guidelines for AI assistants, including safety, CI, and logging rules.
  • Refine various code and test formatting for consistency and readability.

Build:

  • Adjust Dependabot configuration to run daily and simplify labeling for dependency-related PRs.

CI:

  • Add GitHub Actions workflows for AI PR review, AI issue triage, continuous AI improvement, and automated repository analysis and documentation generation.

Documentation:

  • Add AGENTS.md documenting rules and best practices for AI agents and automation in the repository.

Tests:

  • Minor formatting improvements in existing tests for analyze-core and analysisService to keep them consistent with style rules.

Chores:

  • Generate and commit repository stats, architecture diagrams, and knowledge graph artifacts automatically on main branch updates.

This commit adds a suite of automated tools and GitHub workflows to transform the repository into a self-maintaining ecosystem:
- AI Issue Triager (`scripts/automation/ai-triage.ts`)
- AI Pull Request Reviewer (`scripts/automation/ai-pr-review.ts`)
- AI Continuous Improvement Loop (`scripts/automation/ai-improve.ts`)
- Repository Architecture Intelligence (`scripts/automation/analyze-repo.ts`, `generate-diagrams.ts`, `generate-knowledge-graph.ts`)
- GitHub workflows to execute these scripts autonomously
- Dependabot configuration for automated dependency updates
- `AGENTS.md` file providing comprehensive guidelines for AI assistants and automation tools.

All scripts use the Google GenAI SDK and run via `tsx`. Tests, formatting, and linting have been verified. Code review feedback implemented to ensure robust environment setups (e.g. installing Graphviz) and safe string handling in GitHub Actions (reading from filesystem directly instead of via Env vars).

Co-authored-by: NITISH-R-G <225521762+NITISH-R-G@users.noreply.github.com>
@google-labs-jules

Copy link
Copy Markdown
Contributor

👋 Jules, reporting for duty! I'm here to lend a hand with this pull request.

When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down.

I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job!

For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with @jules. You can find this option in the Pull Request section of your global Jules UI settings. You can always switch back!

New to Jules? Learn more at jules.google/docs.


For security, I will only act on instructions from the user who triggered this task.

@vercel

vercel Bot commented Jul 21, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
intelli-credit-v2 Ready Ready Preview, Comment Jul 21, 2026 7:01pm

@sourcery-ai

sourcery-ai Bot commented Jul 21, 2026

Copy link
Copy Markdown

Reviewer's Guide

Introduces a suite of AI-driven automation capabilities (issue triage, PR review, continuous improvement, repo analysis and diagram/knowledge graph generation) via new scripts and GitHub Actions, adds supporting dependencies and documentation for agents, and adjusts existing configs/workflows for autonomy and safety while keeping AI-related scripts non-breaking when secrets are absent.

Sequence diagram for AI Issue Triage workflow

sequenceDiagram
  actor IssueAuthor
  participant GitHub
  participant AI_Triage_Workflow
  participant AI_Triage_Script
  participant GoogleGenAI

  IssueAuthor->>GitHub: Open issue
  GitHub-->>AI_Triage_Workflow: issues.opened event
  AI_Triage_Workflow->>AI_Triage_Script: npm run ai:triage
  AI_Triage_Script->>AI_Triage_Script: fs.readFileSync(GITHUB_EVENT_PATH)
  AI_Triage_Script->>GoogleGenAI: models.generateContent
  GoogleGenAI-->>AI_Triage_Script: triage response
  AI_Triage_Script->>AI_Triage_Script: fs.writeFileSync(triage-comment.txt)
  AI_Triage_Workflow->>GitHub: create-or-update-comment@v4 (body-path=triage-comment.txt)
  GitHub-->>IssueAuthor: AI triage comment added
Loading

File-Level Changes

Change Details Files
Add AI-powered issue triage, PR review, and continuous improvement workflows backed by Node scripts using Google GenAI and safe file-based outputs.
  • Create ai-triage, ai-pr-review, and ai-improve TypeScript scripts that call Google GenAI, read GitHub event payloads or PR diffs, and write Markdown comments/reports to files for Actions to consume.
  • Configure ai-triage.yml, ai-pr-reviewer.yml, and ai-continuous-improvement.yml workflows to run on issues, pull requests, or schedules, install Node dependencies, invoke the AI scripts, and post comments or create issues based on generated files.
  • Ensure AI scripts exit with code 0 when GEMINI_API_KEY is missing and use console.info/warn/error plus execFileSync patterns for safety.
scripts/automation/ai-triage.ts
scripts/automation/ai-pr-review.ts
scripts/automation/ai-improve.ts
.github/workflows/ai-triage.yml
.github/workflows/ai-pr-reviewer.yml
.github/workflows/ai-continuous-improvement.yml
Add automated repository analysis, architecture diagram generation, and knowledge graph export executed via CI.
  • Implement analyze-repo.ts to compute simple repo stats from git ls-files and write them to docs/architecture/repo-stats.json.
  • Implement generate-diagrams.ts to invoke madge via npx with execFileSync and output a dependency-graph.svg into docs/architecture.
  • Implement generate-knowledge-graph.ts to build a JSON node list for all tracked files and write docs/architecture/knowledge-graph.json.
  • Add repo-analysis.yml workflow to run the analysis and generation scripts on main pushes or manual dispatch, then commit docs/architecture changes back to the repo.
scripts/automation/analyze-repo.ts
scripts/automation/generate-diagrams.ts
scripts/automation/generate-knowledge-graph.ts
.github/workflows/repo-analysis.yml
Expose new automation entrypoints and dependencies in package.json, and centralize a self-healing fix command.
  • Add npm scripts for ai:triage, ai:improve, ai:pr-review, analyze:repo, generate:diagrams, generate:knowledge-graph, and a fix script that runs format then lint:fix.
  • Introduce madge as a devDependency to support dependency graph generation.
  • Keep existing test, lint, and format scripts intact while wiring the new automation scripts into CI workflows.
package.json
package-lock.json
Document AI agent operational rules and tighten contributor and workflow guidance.
  • Create AGENTS.md describing automation expectations, safe command execution, required use of console.info/warn/error, AI model choices, and workflow configuration best practices.
  • Clarify CONTRIBUTING.md label table formatting for better readability of triage labels.
  • Ensure guidelines mention GEMINI_API_KEY handling, directory creation for docs, and integration details with GitHub Actions comment/issue actions.
AGENTS.md
CONTRIBUTING.md
Adjust dependency update cadence and minor formatting/style in existing code and documentation.
  • Update dependabot configuration to run npm and GitHub Actions checks daily and remove auto-apply labels from Dependabot PRs.
  • Apply Prettier-style reformatting to various TypeScript/Markdown files (tests, API libs, limits, changelog, App, analysisService) to enforce consistent wrapping and spacing.
  • Make small style-only changes that do not alter logic, such as inline conditionals and removing extra blank lines.
.github/dependabot.yml
CHANGELOG.md
api/_lib/mcp-tools.ts
api/_lib/__tests__/analyze-core.test.ts
api/_lib/limits.ts
api/analyze.ts
src/services/__tests__/analysisService.test.ts
src/App.tsx
src/services/analysisService.ts

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

@greptile-apps greptile-apps 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.

Your trial has ended. Reactivate Greptile to resume code reviews.

@github-actions github-actions Bot added documentation Improvements or additions to documentation dependencies Pull requests that update a dependency file github-actions frontend backend labels Jul 21, 2026
@coderabbitai

coderabbitai Bot commented Jul 21, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@NITISH-R-G, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 51 seconds

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 0504439b-b4fb-41a6-9348-f11655174c5c

📥 Commits

Reviewing files that changed from the base of the PR and between cd9deb9 and 0814ba6.

📒 Files selected for processing (14)
  • .github/workflows/ai-continuous-improvement.yml
  • .github/workflows/ai-pr-reviewer.yml
  • .github/workflows/ai-triage.yml
  • .github/workflows/ci-cd-automation.yml
  • .github/workflows/codeql.yml
  • .github/workflows/dependency-review.yml
  • .github/workflows/repo-analysis.yml
  • scripts/automation/ai-improve.ts
  • scripts/automation/ai-pr-review.ts
  • scripts/automation/ai-triage.ts
  • scripts/automation/analyze-repo.ts
  • scripts/automation/generate-knowledge-graph.ts
  • src/App.tsx
  • src/services/__tests__/analysisService.test.ts
📝 Walkthrough

Walkthrough

Adds Gemini-powered issue triage, PR review, continuous improvement, and repository analysis automation through new scripts, npm commands, and GitHub Actions workflows. It also adds operational guidance, daily Dependabot checks, architecture artifact generation, and formatting-only updates.

Changes

AI Automation

Layer / File(s) Summary
AI automation entry points
package.json, scripts/automation/ai-*.ts
Adds npm commands and Gemini-backed scripts that generate improvement reports, PR review comments, and issue triage comments.
GitHub Actions integration
.github/workflows/ai-*.yml
Adds scheduled and event-driven workflows that run the automation scripts and publish generated outputs to issues or pull requests.
Repository analysis generation
.github/workflows/repo-analysis.yml, scripts/automation/analyze-repo.ts, scripts/automation/generate-*.ts
Generates repository statistics, dependency diagrams, and a knowledge graph, then commits updates under docs/architecture/.
Automation guidance and update scheduling
AGENTS.md, .github/dependabot.yml
Documents automation conventions and changes npm and GitHub Actions dependency checks to daily schedules.
Documentation and existing-code formatting
CHANGELOG.md, CONTRIBUTING.md, api/..., src/..., vercel.json
Reformats documentation, tests, configuration, and existing code without changing described runtime behavior.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant GitHub
  participant Workflow
  participant AutomationScript
  participant Gemini
  participant IssueOrPullRequest
  GitHub->>Workflow: trigger issue, pull request, or scheduled run
  Workflow->>AutomationScript: execute npm automation command
  AutomationScript->>Gemini: submit issue, diff, or repository prompt
  Gemini-->>AutomationScript: return generated Markdown
  AutomationScript->>IssueOrPullRequest: publish generated report or comment
Loading

Possibly related PRs

Poem

I’m a rabbit with scripts in my burrow so bright,
Gemini reviews hop through issues at night.
Graphs bloom in docs, Dependabot runs fast,
Reports leave neat comments wherever they’re cast.
A carrot for automation—what a wonderful feat! 🐇

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main theme of adding autonomous repository management and AI automation.
Description check ✅ Passed The description is clearly related to the changeset and covers the added workflows, scripts, and repository automation.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch ai-repo-automation-8966888486129833830

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.

@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 left some high level feedback:

  • The AI scripts that send issue bodies and full PR diffs to Gemini (ai-triage.ts, ai-pr-review.ts) don’t currently bound or truncate input size, which could lead to oversized payloads or higher cost; consider enforcing a max length and summarizing or trimming content before sending to the model.
  • The repo-analysis.yml workflow auto-commits to main on every push, which can create noisy commit history and potential race conditions with concurrent pushes; consider running only on a schedule or using a separate docs/automation branch to avoid CI modifying the main development branch.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- The AI scripts that send issue bodies and full PR diffs to Gemini (`ai-triage.ts`, `ai-pr-review.ts`) don’t currently bound or truncate input size, which could lead to oversized payloads or higher cost; consider enforcing a max length and summarizing or trimming content before sending to the model.
- The `repo-analysis.yml` workflow auto-commits to `main` on every push, which can create noisy commit history and potential race conditions with concurrent pushes; consider running only on a schedule or using a separate docs/automation branch to avoid CI modifying the main development branch.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@coderabbitai coderabbitai 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.

Actionable comments posted: 10

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/ai-continuous-improvement.yml:
- Around line 15-34: Pin every third-party GitHub Action to a full immutable
commit SHA instead of a mutable version tag: update actions/checkout,
actions/setup-node, and peter-evans/create-issue-from-file in
.github/workflows/ai-continuous-improvement.yml lines 15-34; actions/checkout,
actions/setup-node, and thollander/actions-comment-pull-request in
.github/workflows/ai-pr-reviewer.yml lines 14-43; and actions/checkout,
actions/setup-node, and peter-evans/create-or-update-comment in
.github/workflows/ai-triage.yml lines 14-33.

In @.github/workflows/ai-pr-reviewer.yml:
- Around line 28-32: Update the “Get PR diff” step to assign github.base_ref
directly in its env block, then reference that environment variable in the git
fetch and git diff commands with proper shell quoting; remove the inline GitHub
expression from the run script while preserving the existing diff behavior.

In @.github/workflows/repo-analysis.yml:
- Around line 3-7: Add a workflow-level concurrency group to the
repository-analysis workflow, covering both push-to-main and workflow_dispatch
triggers, so only one publishing run executes at a time and concurrent runs are
serialized.
- Around line 44-46: Update the workflow’s commit/push step to check explicitly
whether the staged index has changes before committing. Skip the commit only
when no generated files are staged, remove the `|| echo` failure masking, and
allow genuine `git commit` and `git push` failures to fail the job.
- Around line 16-20: Update the Checkout repository and Setup Node.js steps to
pin actions/checkout and actions/setup-node to their full immutable commit SHAs
instead of mutable version tags, preserving the corresponding version comments
for readability.
- Around line 9-10: Update the workflow’s checkout and permissions configuration
so the repository token is not persisted during npm ci or generator execution:
set checkout’s persist-credentials to false, and scope contents: write only to
the final commit/push step while keeping generation steps read-only.

In `@scripts/automation/ai-improve.ts`:
- Around line 14-18: Update the prompt construction in the automation script to
gather bounded repository evidence—such as relevant code, configuration, test
results, and metadata—and include it before recommendation generation. Clearly
delimit this material as untrusted repository context, preserve the requirement
for exactly three actionable Markdown recommendations, and ensure the generated
report remains the only published output.

In `@scripts/automation/analyze-repo.ts`:
- Around line 15-16: Update the file-list generation in
scripts/automation/analyze-repo.ts at lines 15-16 and
scripts/automation/generate-knowledge-graph.ts at lines 14-15: invoke git
ls-files with NUL-delimited output using -z, then split the result on \0 instead
of newline characters. Preserve the existing filtering of empty entries in both
generators.

In `@scripts/automation/generate-knowledge-graph.ts`:
- Line 18: Update the node mapping in the knowledge-graph generation flow so
extensionless entries from git ls-files receive a file-specific group instead of
the 'folder' fallback. Preserve extension-based groups for files with
extensions, and only classify actual directory nodes as folders if directory
nodes are derived separately.
- Around line 17-20: Update the graph construction in the knowledge-graph
generation workflow so links contains the intended repository relationships
rather than always being an empty array; ensure generated artifacts represent
connected file relationships. If relationship generation is not implemented,
rename the artifact and workflow step to describe a file inventory instead of a
knowledge graph.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 89134b48-c84b-46cd-83d1-3957e13ff7df

📥 Commits

Reviewing files that changed from the base of the PR and between 95846c3 and cd9deb9.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (23)
  • .github/dependabot.yml
  • .github/workflows/ai-continuous-improvement.yml
  • .github/workflows/ai-pr-reviewer.yml
  • .github/workflows/ai-triage.yml
  • .github/workflows/repo-analysis.yml
  • AGENTS.md
  • CHANGELOG.md
  • CONTRIBUTING.md
  • api/_lib/__tests__/analyze-core.test.ts
  • api/_lib/limits.ts
  • api/_lib/mcp-tools.ts
  • api/analyze.ts
  • package.json
  • scripts/automation/ai-improve.ts
  • scripts/automation/ai-pr-review.ts
  • scripts/automation/ai-triage.ts
  • scripts/automation/analyze-repo.ts
  • scripts/automation/generate-diagrams.ts
  • scripts/automation/generate-knowledge-graph.ts
  • src/App.tsx
  • src/services/__tests__/analysisService.test.ts
  • src/services/analysisService.ts
  • vercel.json
💤 Files with no reviewable changes (2)
  • src/services/analysisService.ts
  • src/App.tsx
📜 Review details
🧰 Additional context used
📓 Path-based instructions (3)
scripts/automation/**

📄 CodeRabbit inference engine (AGENTS.md)

scripts/automation/**: Automate repetitive tasks by creating scripts in scripts/automation/ or GitHub workflows instead of performing repetitive work manually.
AI scripts must exit gracefully with status code 0 when GEMINI_API_KEY is missing.
Automation scripts must not use console.log; use console.info, console.warn, or console.error instead.
Avoid execSync with concatenated strings; use execFileSync with separate executable and argument arrays.
When invoking npx through execFileSync in automated scripts, always include the --yes flag.
AI scripts that provide data to GitHub Actions must write final comments or output directly to dedicated files using fs.writeFileSync, rather than piping standard output.
Automation scripts must create required parent directories, such as docs/history/ and docs/architecture/, with fs.mkdirSync(dir, { recursive: true }) before writing outputs.

Files:

  • scripts/automation/generate-diagrams.ts
  • scripts/automation/generate-knowledge-graph.ts
  • scripts/automation/analyze-repo.ts
  • scripts/automation/ai-triage.ts
  • scripts/automation/ai-pr-review.ts
  • scripts/automation/ai-improve.ts
scripts/automation/**/*.ts

📄 CodeRabbit inference engine (AGENTS.md)

AI automation scripts using the Google GenAI SDK must use the gemini-2.0-flash model for repository tasks, including triage, PR review, and improvement loops.

Files:

  • scripts/automation/generate-diagrams.ts
  • scripts/automation/generate-knowledge-graph.ts
  • scripts/automation/analyze-repo.ts
  • scripts/automation/ai-triage.ts
  • scripts/automation/ai-pr-review.ts
  • scripts/automation/ai-improve.ts
.github/workflows/*.{yml,yaml}

📄 CodeRabbit inference engine (AGENTS.md)

.github/workflows/*.{yml,yaml}: GitHub Actions event variables must be assigned directly in a step's env block and referenced in run scripts, rather than injected inline with ${{ }}.
When using thollander/actions-comment-pull-request@v3, use kebab-case input names such as file-path and comment-tag.
Conditionally skip action steps using file-presence checks such as if: hashFiles('triage-comment.txt') != '', rather than step-scoped environment variables.

Files:

  • .github/workflows/ai-triage.yml
  • .github/workflows/repo-analysis.yml
  • .github/workflows/ai-continuous-improvement.yml
  • .github/workflows/ai-pr-reviewer.yml
🧠 Learnings (1)
📓 Common learnings
Learnt from: CR
Repo: NITISH-R-G/Intelli-Credit-V2

Timestamp: 2026-07-21T18:01:50.753Z
Learning: Run `npm run fix` before manually correcting formatting or linting issues.
Learnt from: CR
Repo: NITISH-R-G/Intelli-Credit-V2

Timestamp: 2026-07-21T18:01:50.753Z
Learning: Before committing changes, run `npm test`, `npm run format`, and `npm run lint`.
🪛 ast-grep (0.44.1)
scripts/automation/generate-diagrams.ts

[warning] 2-2: Importing child_process exposes a command-execution surface; ensure any command/argument built from input is validated, and prefer execFile/spawn with an argument array over exec.
Context: import { execFileSync } from 'node:child_process';
Note: [CWE-78] Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').

(detect-child-process-typescript)

scripts/automation/generate-knowledge-graph.ts

[warning] 2-2: Importing child_process exposes a command-execution surface; ensure any command/argument built from input is validated, and prefer execFile/spawn with an argument array over exec.
Context: import { execFileSync } from 'node:child_process';
Note: [CWE-78] Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').

(detect-child-process-typescript)


[warning] 22-22: Filesystem path is not a string literal; a request-/variable-derived path can enable path traversal. Validate and normalize the path before use.
Context: fs.writeFileSync(graphPath, JSON.stringify(graph, null, 2))
Note: [CWE-22] Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').

(detect-non-literal-fs-filename-typescript)

scripts/automation/analyze-repo.ts

[warning] 2-2: Importing child_process exposes a command-execution surface; ensure any command/argument built from input is validated, and prefer execFile/spawn with an argument array over exec.
Context: import { execFileSync } from 'node:child_process';
Note: [CWE-78] Improper Neutralization of Special Elements used in an OS Command ('OS Command Injection').

(detect-child-process-typescript)


[warning] 27-27: Filesystem path is not a string literal; a request-/variable-derived path can enable path traversal. Validate and normalize the path before use.
Context: fs.writeFileSync(reportPath, JSON.stringify(stats, null, 2))
Note: [CWE-22] Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').

(detect-non-literal-fs-filename-typescript)

scripts/automation/ai-triage.ts

[warning] 16-16: Filesystem path is not a string literal; a request-/variable-derived path can enable path traversal. Validate and normalize the path before use.
Context: fs.readFileSync(eventPath, 'utf8')
Note: [CWE-22] Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').

(detect-non-literal-fs-filename-typescript)

scripts/automation/ai-pr-review.ts

[warning] 12-12: Filesystem path is not a string literal; a request-/variable-derived path can enable path traversal. Validate and normalize the path before use.
Context: fs.readFileSync(diffFile, 'utf-8')
Note: [CWE-22] Improper Limitation of a Pathname to a Restricted Directory ('Path Traversal').

(detect-non-literal-fs-filename-typescript)

🪛 GitHub Check: SonarCloud Code Analysis
scripts/automation/generate-diagrams.ts

[warning] 17-17: Make sure the "PATH" variable only contains fixed, unwriteable directories.

See more on https://sonarcloud.io/project/issues?id=NITISH-R-G_Intelli-Credit-V2&issues=AZ-F17YoU20n6vaU_L-7&open=AZ-F17YoU20n6vaU_L-7&pullRequest=122

scripts/automation/generate-knowledge-graph.ts

[warning] 14-14: Make sure the "PATH" variable only contains fixed, unwriteable directories.

See more on https://sonarcloud.io/project/issues?id=NITISH-R-G_Intelli-Credit-V2&issues=AZ-F17UHU20n6vaU_L-1&open=AZ-F17UHU20n6vaU_L-1&pullRequest=122

scripts/automation/analyze-repo.ts

[warning] 15-15: Make sure the "PATH" variable only contains fixed, unwriteable directories.

See more on https://sonarcloud.io/project/issues?id=NITISH-R-G_Intelli-Credit-V2&issues=AZ-F17X5U20n6vaU_L-4&open=AZ-F17X5U20n6vaU_L-4&pullRequest=122

scripts/automation/ai-triage.ts

[warning] 60-60: Prefer top-level await over an async function triage call.

See more on https://sonarcloud.io/project/issues?id=NITISH-R-G_Intelli-Credit-V2&issues=AZ-F17YIU20n6vaU_L-6&open=AZ-F17YIU20n6vaU_L-6&pullRequest=122


[warning] 18-18: Prefer using an optional chain expression instead, as it's more concise and easier to read.

See more on https://sonarcloud.io/project/issues?id=NITISH-R-G_Intelli-Credit-V2&issues=AZ-F17YIU20n6vaU_L-5&open=AZ-F17YIU20n6vaU_L-5&pullRequest=122

.github/workflows/ai-triage.yml

[failure] 33-33: Use full commit SHA hash for this dependency.

See more on https://sonarcloud.io/project/issues?id=NITISH-R-G_Intelli-Credit-V2&issues=AZ-F17Y7U20n6vaU_L-9&open=AZ-F17Y7U20n6vaU_L-9&pullRequest=122


[warning] 24-24: Omitting "--ignore-scripts" allows lifecycle scripts to run during package installation.

See more on https://sonarcloud.io/project/issues?id=NITISH-R-G_Intelli-Credit-V2&issues=AZ-F17Y7U20n6vaU_L-8&open=AZ-F17Y7U20n6vaU_L-8&pullRequest=122

.github/workflows/repo-analysis.yml

[warning] 26-26: Omitting "--ignore-scripts" allows lifecycle scripts to run during package installation.

See more on https://sonarcloud.io/project/issues?id=NITISH-R-G_Intelli-Credit-V2&issues=AZ-F17ZUU20n6vaU_L_A&open=AZ-F17ZUU20n6vaU_L_A&pullRequest=122

.github/workflows/ai-continuous-improvement.yml

[failure] 34-34: Use full commit SHA hash for this dependency.

See more on https://sonarcloud.io/project/issues?id=NITISH-R-G_Intelli-Credit-V2&issues=AZ-F17ZDU20n6vaU_L-_&open=AZ-F17ZDU20n6vaU_L-_&pullRequest=122


[warning] 25-25: Omitting "--ignore-scripts" allows lifecycle scripts to run during package installation.

See more on https://sonarcloud.io/project/issues?id=NITISH-R-G_Intelli-Credit-V2&issues=AZ-F17ZDU20n6vaU_L--&open=AZ-F17ZDU20n6vaU_L--&pullRequest=122

scripts/automation/ai-pr-review.ts

[warning] 48-48: Prefer top-level await over an async function reviewPR call.

See more on https://sonarcloud.io/project/issues?id=NITISH-R-G_Intelli-Credit-V2&issues=AZ-F17W_U20n6vaU_L-2&open=AZ-F17W_U20n6vaU_L-2&pullRequest=122

scripts/automation/ai-improve.ts

[warning] 37-37: Prefer top-level await over an async function improveRepo call.

See more on https://sonarcloud.io/project/issues?id=NITISH-R-G_Intelli-Credit-V2&issues=AZ-F17XhU20n6vaU_L-3&open=AZ-F17XhU20n6vaU_L-3&pullRequest=122

.github/workflows/ai-pr-reviewer.yml

[warning] 26-26: Omitting "--ignore-scripts" allows lifecycle scripts to run during package installation.

See more on https://sonarcloud.io/project/issues?id=NITISH-R-G_Intelli-Credit-V2&issues=AZ-F17ZgU20n6vaU_L_B&open=AZ-F17ZgU20n6vaU_L_B&pullRequest=122


[failure] 43-43: Use full commit SHA hash for this dependency.

See more on https://sonarcloud.io/project/issues?id=NITISH-R-G_Intelli-Credit-V2&issues=AZ-F17ZgU20n6vaU_L_C&open=AZ-F17ZgU20n6vaU_L_C&pullRequest=122

🪛 LanguageTool
AGENTS.md

[style] ~19-~19: Try using a synonym here to strengthen your wording.
Context: ...pr-review.ts`) should write their final comment or output directly to a dedicated file ...

(COMMENT_REMARK)

🪛 zizmor (1.26.1)
.github/workflows/ai-triage.yml

[warning] 14-15: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false

(artipacked)


[error] 8-8: overly broad permissions (excessive-permissions): issues: write is overly broad at the workflow level

(excessive-permissions)


[error] 15-15: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)

(unpinned-uses)


[error] 18-18: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)

(unpinned-uses)


[error] 33-33: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)

(unpinned-uses)


[warning] 8-8: permissions without explanatory comments (undocumented-permissions): needs an explanatory comment

(undocumented-permissions)


[info] 11-11: workflow or action definition without a name (anonymous-definition): this job

(anonymous-definition)


[warning] 3-5: insufficient job-level concurrency limits (concurrency-limits): workflow is missing concurrency setting

(concurrency-limits)


[info] 33-33: action functionality is already included by the runner (superfluous-actions): use gh pr comment or gh issue comment in a script step

(superfluous-actions)

.github/workflows/repo-analysis.yml

[warning] 16-17: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false

(artipacked)


[error] 10-10: overly broad permissions (excessive-permissions): contents: write is overly broad at the workflow level

(excessive-permissions)


[error] 17-17: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)

(unpinned-uses)


[error] 20-20: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)

(unpinned-uses)


[warning] 10-10: permissions without explanatory comments (undocumented-permissions): needs an explanatory comment

(undocumented-permissions)


[info] 13-13: workflow or action definition without a name (anonymous-definition): this job

(anonymous-definition)


[warning] 3-7: insufficient job-level concurrency limits (concurrency-limits): workflow is missing concurrency setting

(concurrency-limits)

.github/workflows/ai-continuous-improvement.yml

[warning] 15-16: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false

(artipacked)


[error] 9-9: overly broad permissions (excessive-permissions): issues: write is overly broad at the workflow level

(excessive-permissions)


[error] 16-16: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)

(unpinned-uses)


[error] 19-19: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)

(unpinned-uses)


[error] 34-34: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)

(unpinned-uses)


[warning] 9-9: permissions without explanatory comments (undocumented-permissions): needs an explanatory comment

(undocumented-permissions)


[info] 12-12: workflow or action definition without a name (anonymous-definition): this job

(anonymous-definition)


[warning] 3-6: insufficient job-level concurrency limits (concurrency-limits): workflow is missing concurrency setting

(concurrency-limits)

.github/workflows/ai-pr-reviewer.yml

[warning] 14-17: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false

(artipacked)


[error] 8-8: overly broad permissions (excessive-permissions): pull-requests: write is overly broad at the workflow level

(excessive-permissions)


[error] 31-31: code injection via template expansion (template-injection): may expand into attacker-controllable code

(template-injection)


[error] 32-32: code injection via template expansion (template-injection): may expand into attacker-controllable code

(template-injection)


[error] 15-15: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)

(unpinned-uses)


[error] 20-20: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)

(unpinned-uses)


[error] 43-43: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)

(unpinned-uses)


[warning] 8-8: permissions without explanatory comments (undocumented-permissions): needs an explanatory comment

(undocumented-permissions)


[info] 11-11: workflow or action definition without a name (anonymous-definition): this job

(anonymous-definition)


[warning] 3-5: insufficient job-level concurrency limits (concurrency-limits): workflow is missing concurrency setting

(concurrency-limits)

🔇 Additional comments (15)
AGENTS.md (1)

1-29: LGTM!

.github/dependabot.yml (1)

6-8: LGTM!

Also applies to: 11-13

CHANGELOG.md (1)

11-17: LGTM!

Also applies to: 27-27, 43-50, 59-59

CONTRIBUTING.md (1)

150-162: LGTM!

api/_lib/__tests__/analyze-core.test.ts (1)

69-71: LGTM!

api/_lib/limits.ts (1)

30-31: LGTM!

api/_lib/mcp-tools.ts (1)

27-27: LGTM!

Also applies to: 126-133

api/analyze.ts (1)

196-196: LGTM!

src/services/__tests__/analysisService.test.ts (1)

541-547: LGTM!

Also applies to: 558-562

vercel.json (1)

30-30: LGTM!

package.json (1)

32-39: LGTM!

Also applies to: 78-78

scripts/automation/ai-pr-review.ts (1)

1-48: LGTM!

scripts/automation/ai-triage.ts (1)

1-60: LGTM!

scripts/automation/analyze-repo.ts (1)

1-14: LGTM!

Also applies to: 17-36

scripts/automation/generate-diagrams.ts (1)

1-29: LGTM!

Comment thread .github/workflows/ai-continuous-improvement.yml Outdated
Comment on lines +28 to +32
- name: Get PR diff
id: pr_diff
run: |
git fetch origin ${{ github.base_ref }}
git diff origin/${{ github.base_ref }}...HEAD > pr-diff.txt

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Move the base ref into the step environment.

The inline expression is rendered into shell source, so a metacharacter-bearing branch name can alter the commands. Bind it once and quote its uses.

Proposed fix
       - name: Get PR diff
         id: pr_diff
+        env:
+          BASE_REF: ${{ github.base_ref }}
         run: |
-          git fetch origin ${{ github.base_ref }}
-          git diff origin/${{ github.base_ref }}...HEAD > pr-diff.txt
+          git fetch origin "$BASE_REF"
+          git diff "origin/$BASE_REF...HEAD" > pr-diff.txt

As per coding guidelines, GitHub Actions event variables must be assigned directly in a step's env block and referenced in run scripts, rather than injected inline with ${{ }}.

📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- name: Get PR diff
id: pr_diff
run: |
git fetch origin ${{ github.base_ref }}
git diff origin/${{ github.base_ref }}...HEAD > pr-diff.txt
- name: Get PR diff
id: pr_diff
env:
BASE_REF: ${{ github.base_ref }}
run: |
git fetch origin "$BASE_REF"
git diff "origin/$BASE_REF...HEAD" > pr-diff.txt
🧰 Tools
🪛 zizmor (1.26.1)

[error] 31-31: code injection via template expansion (template-injection): may expand into attacker-controllable code

(template-injection)


[error] 32-32: code injection via template expansion (template-injection): may expand into attacker-controllable code

(template-injection)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/ai-pr-reviewer.yml around lines 28 - 32, Update the “Get
PR diff” step to assign github.base_ref directly in its env block, then
reference that environment variable in the git fetch and git diff commands with
proper shell quoting; remove the inline GitHub expression from the run script
while preserving the existing diff behavior.

Sources: Coding guidelines, Linters/SAST tools

Comment on lines +3 to +7
on:
push:
branches:
- main
workflow_dispatch:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Serialize repository-analysis runs before pushing.

A push to main and a manual dispatch can run concurrently, causing both jobs to generate from the same revision and race at git push. Add a workflow concurrency group so publishing runs are serialized.

🧰 Tools
🪛 zizmor (1.26.1)

[warning] 3-7: insufficient job-level concurrency limits (concurrency-limits): workflow is missing concurrency setting

(concurrency-limits)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/repo-analysis.yml around lines 3 - 7, Add a workflow-level
concurrency group to the repository-analysis workflow, covering both
push-to-main and workflow_dispatch triggers, so only one publishing run executes
at a time and concurrent runs are serialized.

Source: Linters/SAST tools

Comment on lines +9 to +10
permissions:
contents: write

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

file=".github/workflows/repo-analysis.yml"
wc -l "$file"
sed -n '1,220p' "$file"

Repository: NITISH-R-G/Intelli-Credit-V2

Length of output: 1348


Limit write access to the publish step.

contents: write plus the default actions/checkout credential persistence makes the repo token available to npm ci and the generators. Set persist-credentials: false on checkout and pass write access only to the final commit/push step, or split generation and publishing into separate jobs.

🧰 Tools
🪛 zizmor (1.26.1)

[error] 10-10: overly broad permissions (excessive-permissions): contents: write is overly broad at the workflow level

(excessive-permissions)


[warning] 10-10: permissions without explanatory comments (undocumented-permissions): needs an explanatory comment

(undocumented-permissions)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/repo-analysis.yml around lines 9 - 10, Update the
workflow’s checkout and permissions configuration so the repository token is not
persisted during npm ci or generator execution: set checkout’s
persist-credentials to false, and scope contents: write only to the final
commit/push step while keeping generation steps read-only.

Source: Linters/SAST tools

Comment thread .github/workflows/repo-analysis.yml Outdated
Comment on lines +44 to +46
git add docs/architecture/
git commit -m "docs: auto-generate repository architecture and knowledge graph" || echo "No changes to commit"
git push

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🩺 Stability & Availability | 🟠 Major | ⚡ Quick win

Do not hide commit failures behind || echo.

git commit returns non-zero for real failures as well as for an empty index. The current command masks errors and can let the workflow appear successful without publishing generated files. Check whether the index is clean explicitly, then let genuine commit and push failures fail the job.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/repo-analysis.yml around lines 44 - 46, Update the
workflow’s commit/push step to check explicitly whether the staged index has
changes before committing. Skip the commit only when no generated files are
staged, remove the `|| echo` failure masking, and allow genuine `git commit` and
`git push` failures to fail the job.

Comment on lines +14 to +18
const prompt = `You are an autonomous AI Continuous Improvement agent for an open-source repository.
Your task is to suggest repository improvements.
Think about potential refactoring, test additions, documentation enhancements, automation improvements, security hardening, etc.

Generate a Markdown report detailing 3 actionable recommendations for improving this repository. Include code snippets or configuration examples where appropriate. Output only the Markdown content.`;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift

Provide repository context before generating recommendations.

This prompt supplies no code, configuration, test results, or repository metadata, so the daily workflow will create generic recommendations rather than repository-specific improvements. Gather bounded repository evidence and delimit it as untrusted context in the prompt before publishing an issue.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/automation/ai-improve.ts` around lines 14 - 18, Update the prompt
construction in the automation script to gather bounded repository evidence—such
as relevant code, configuration, test results, and metadata—and include it
before recommendation generation. Clearly delimit this material as untrusted
repository context, preserve the requirement for exactly three actionable
Markdown recommendations, and ensure the generated report remains the only
published output.

Comment thread scripts/automation/analyze-repo.ts Outdated
Comment on lines +15 to +16
const allFilesOutput = execFileSync('git', ['ls-files'], { encoding: 'utf-8' });
const files = allFilesOutput.split('\n').filter(Boolean);

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Use NUL-delimited Git output in both generators.

Both scripts incorrectly assume tracked filenames cannot contain newlines, causing incorrect statistics and corrupted graph node IDs.

  • scripts/automation/analyze-repo.ts#L15-L16: invoke git ls-files -z and split on \0.
  • scripts/automation/generate-knowledge-graph.ts#L14-L15: invoke git ls-files -z and split on \0.
🧰 Tools
🪛 GitHub Check: SonarCloud Code Analysis

[warning] 15-15: Make sure the "PATH" variable only contains fixed, unwriteable directories.

See more on https://sonarcloud.io/project/issues?id=NITISH-R-G_Intelli-Credit-V2&issues=AZ-F17X5U20n6vaU_L-4&open=AZ-F17X5U20n6vaU_L-4&pullRequest=122

📍 Affects 2 files
  • scripts/automation/analyze-repo.ts#L15-L16 (this comment)
  • scripts/automation/generate-knowledge-graph.ts#L14-L15
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/automation/analyze-repo.ts` around lines 15 - 16, Update the
file-list generation in scripts/automation/analyze-repo.ts at lines 15-16 and
scripts/automation/generate-knowledge-graph.ts at lines 14-15: invoke git
ls-files with NUL-delimited output using -z, then split the result on \0 instead
of newline characters. Preserve the existing filtering of empty entries in both
generators.

Comment on lines +17 to +20
const graph = {
nodes: files.map((file) => ({ id: file, group: path.extname(file) || 'folder' })),
links: [], // Advanced link generation logic could be added here
};

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift

Generate relationships before calling this a knowledge graph.

links is permanently empty, so every generated artifact contains only disconnected file nodes. This does not satisfy the stated knowledge-graph objective; either generate the intended repository relationships or rename the artifact and workflow step to describe a file inventory.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/automation/generate-knowledge-graph.ts` around lines 17 - 20, Update
the graph construction in the knowledge-graph generation workflow so links
contains the intended repository relationships rather than always being an empty
array; ensure generated artifacts represent connected file relationships. If
relationship generation is not implemented, rename the artifact and workflow
step to describe a file inventory instead of a knowledge graph.

const files = allFilesOutput.split('\n').filter(Boolean);

const graph = {
nodes: files.map((file) => ({ id: file, group: path.extname(file) || 'folder' })),

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟡 Minor | ⚡ Quick win

Do not classify extensionless files as folders.

git ls-files returns tracked files only, so files such as LICENSE or Dockerfile are incorrectly assigned group: 'folder'. Use a file-specific fallback or derive directory nodes separately.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@scripts/automation/generate-knowledge-graph.ts` at line 18, Update the node
mapping in the knowledge-graph generation flow so extensionless entries from git
ls-files receive a file-specific group instead of the 'folder' fallback.
Preserve extension-based groups for files with extensions, and only classify
actual directory nodes as folders if directory nodes are derived separately.

…ypeScript code

- Pinned all GitHub Actions to exact commit SHAs in workflow files to meet the "C Security Rating on New Code" requirements.
- Fixed TypeScript unawaited Promise warnings in automation scripts by explicitly marking top-level function calls with `void` (e.g., `void triage();`).
- Fixed missing `type="button"` attribute on `<button>` elements in React components (`src/App.tsx`).
- Added optional chaining to prevent potential null dereference exceptions in `analysisService.test.ts`.

Co-authored-by: NITISH-R-G <225521762+NITISH-R-G@users.noreply.github.com>

@greptile-apps greptile-apps 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.

Your trial has ended. Reactivate Greptile to resume code reviews.

- Pinned remaining GitHub Actions (in `ci-cd-automation.yml`) to exact commit SHAs to address SonarCloud's "Security Rating on New Code" Quality Gate rule.
- Explicitly typed the return value of `execFileSync` to `string` in `analyze-repo.ts` and `generate-knowledge-graph.ts` to fix SonarCloud TypeScript warnings where the union type `Buffer | string` was inferred.

Co-authored-by: NITISH-R-G <225521762+NITISH-R-G@users.noreply.github.com>

@greptile-apps greptile-apps 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.

Your trial has ended. Reactivate Greptile to resume code reviews.

Removes `void` cast from synchronous functions to satisfy SonarCloud vulnerabilities, and adds `as string` casts to `execFileSync` to avoid `Buffer | string` return types where only strings are generated. Tests, lint and types check all pass.

Co-authored-by: NITISH-R-G <225521762+NITISH-R-G@users.noreply.github.com>

@greptile-apps greptile-apps 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.

Your trial has ended. Reactivate Greptile to resume code reviews.

@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
C Security Rating on New Code (required ≥ A)

See analysis details on SonarQube Cloud

💡 Need a hand with PR review? Try Gitar by Sonar!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend dependencies Pull requests that update a dependency file documentation Improvements or additions to documentation frontend github-actions

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant