AI-authored contributions to our codebases

mySociety has had a longstanding mission to help avoid the reinvention of the wheel in civic tech. That’s why most of our code is open source, and that’s what has allowed people to run instances of sites like FixMyStreet, WhatDoTheyKnow and TheyWorkForYou in their own jurisdictions, without having to write code or manage challenges, such as those we mentioned in our previous post, themselves.

So perhaps, rather than hearing about your whole new website, we’d prefer to see you submit some AI-authored code to our existing open source codebases? 

Well, we do — with some caveats — welcome submissions to improve our services. In this brave new world where those submissions may have been created entirely, or with the help of, AI, here are the things to bear in mind:

  • If you have an idea that would improve one of our services, check whether it is already a feature of that site, or has been suggested before on GitHub, our issue tracker — this applies to all submissions, not just those enabled by AI.
    If you don’t see your idea already ticketed, we strongly encourage you to submit a new issue where it can be discussed before you submit any code — especially for features that would make significant changes to our sites. This helps avoid you spending time implementing changes that can’t or won’t be merged.
  • While there is no restriction against code contributions made with the help of AI tools such as Claude, ChatGPT or Copilot, using them comes with responsibilities. Every change still needs a human who understands it and stands behind it.
  • Vibe-written code is usually more complicated and harder to maintain than code that has been more manually created. Our experience so far has been that when code is written by someone with knowledge of the codebase, knowledge of what worked and didn’t work in the past, and knowledge of the real world that the code is trying to represent, their contributions are usually of a better quality than code from a generic Large Language Model that has been tasked with recombining existing solutions, even when it manages to superficially match the style and coding conventions of the wider codebase.
  • That’s where the human comes in: don’t open a pull request you don’t fully understand. You — the human — should be able to explain what the change does, why it’s needed, and how it works, just as you would for code you wrote by hand. You should have tested the code to ensure it works as intended; stripped out anything unnecessary; and made sure to fully disclose where and how AI was used.

It’s a time of change

Civic tech, like all tech, is going through a massive transformation — and we want to think about how best to make this new landscape work for everyone. That means channelling the energy of people working with LLMs into the areas where they can have most benefit, with projects based on more than basic concepts: projects that may be collaborative, with built-in safeguards for longevity, and that above all will work well for their users. Now more than ever, code is only the first step.

AI is also changing, and quickly. So our approach to contributions may also change in the future. But for now, this is where we are.

 

 —

Image: Hanna Barakat (Better Images of AI)