© Sqlephant. All rights reserved.

A Proposal for AI Integration in Open Source Software Dev

Sqlephant genesis for the code generator and SQL injection Fixer

When developing Sqlephant, our SQL code generator and SQL Injection fixer, we aimed to offer our users a feature that allows them to push generated code back to their Git project in a new branch. As Sqlephant is written in Java, we sought a simple Java Git software that would support direct calls like:GitClass.executeGit(“git”, “branch” “my_new_branch”);

However, we found no such tool. JGit, the leading Java library for Git, was designed for Eclipse by specialists. It has a steep learning curve and doesn’t support expressing a Git call as simply as the code line above.
So, we decided to develop our own straightforward implementation as a direct, easy-to-use wrapper of CLI commands:

String repoDirectoryPath = "/path/to/my/git/repository";
final SympleGit sympleGit = SympleGit.custom()

String branchName = "myNewBranch";
// Create gitCommander instance from SympleGit and create a branch
GitCommander gitCommander = sympleGit.gitCommander();
gitCommander.executeGitCommand("git", "branch", branchName);

Nothing revolutionary, indeed.

But we thought it could be helpful for the Java community because of the one-to-one correspondence between GitCommander and the Git command line:

  • It simplifies the process for those not well-versed in Git, allowing them to execute necessary Git commands without errors or spending time searching for the correct API parameters. This makes it easier for Git experts to assist non-experts in implementing accurate Git commands. Conversely, it’s also convenient for Git experts who are less familiar with Java to integrate Git calls into a Java workflow.
  • Given Git’s complexity, the ability to directly use CLI commands in Java enables users to execute complex or uncommon commands without the need to program every option in the API. An example is using detailed Git log commands like:
git log --graph --abbrev-commit --decorate --date=relative --all --pretty=format:'%h - %ar | %s (%an)%d' --max-count=10.

So we released SympleGit with an Apache 2.0 license on GitHub.

Extending SympleGit with Facilitator classes using AI

We thought that adding ready-to-use wrapper classes called “Facilitators” would be useful. For example, for a dedicated class for adding files, we would have:

Class name: AddFile

Method names: addAll() and add(List<String> filenames)

Because we had developed the core classes, we imagined that creating the AddFile could be done by GPT-4, if we passed all the core source code. It worked perfectly well! You can check the GPT-4 code generated, and we released it as-is: GitAdd.java

So AI/GPT-4 could create extended classes, this would still require our input as the developers of the SympleGit project. With a prompt, we generated about ten classes using GPT-4.

Allow SympleGit user to extend SympleGit with their own choices

We provided 10 classes, but this would not cover all needs.

Instead of adding new classes in the software, we decided to add a parameterized prompt and let the user choose the class names and the needed method names. No AI knowledge is required from the user: only how to push a prompt in the GPT-4 browser.

So we provide a parameterized prompt, and the users are required to just change the 3 last lines.

For example, if he needs a Git control class for the Git configuration, he will set the 3 parameters in the parameterized prompt:

${1}=Methods: getUserConfig(), setUserConfig(userName, userEmail), getGlobalConfig(), setGlobalConfig(configKey, configValue)
${2}=For managing Git configurations.

The complete GitConfig is generated in a breeze and the user can include it back as his extension of SympleGit.

This is fully detailed in the README.

The AI-XOSS (AI-Extendable Open Source Software) proposal

Our AI-XOSS proposal encourages open-source developers to create software embedded with parameterized prompts. This design enables users and consumers to extend the software using AI, without needing expertise in AI, or an understanding of the software’s internal structure or architecture.

AI-XOSS brings several notable advantages to the table:

  1. Efficient Evolution of Software: This pattern allows for quick prototyping and addition of new features, enhancing the software’s adaptability.
  2. User Empowerment: AI-XOSS enables users to actively customize and extend the software, meeting their specific needs.
  3. Fostering Collaboration and Creativity: It creates an environment where a variety of ideas can converge, potentially leading to more creative solutions.
  4. Reducing Development Load: By allowing the community to contribute to software development, AI-XOSS can decrease the workload on the core development team.
  5. Enhancing Accessibility: This pattern makes software development more approachable for a wider audience, reducing barriers to entry.
  6. Agility and Adaptation: Software developed under the AI-XOSS model can quickly adjust to changing needs and technological advancements.
  7. Versatility in Applications: The AI-XOSS pattern can be applied across different types of software projects, demonstrating its flexibility.

The AI-XOSS proposal is formalized on the www.ai-xoss.com website.

© Sqlephant - Kawansoft. All rights reserved.