My AI Software Factory Ships Hundreds of PRs a Week (Here's How I Manage It)

summarized

TLDR

The fully autonomous "dark factory" did not survive: Cole Medin has added human-in-the-loop decision points back into his software factory, and says bubbling a minimal set of decisions up to a person is the only way he has found to keep it reliable. His own dashboard shows the evidence, with 21 of hundreds of laps over two weeks failing on workflow bugs and 2 failing on Claude Code rate limits. The dashboard is itself built by the factory, so each improvement to the system also improves the tool used to manage it.

Key points

Medin renamed his fully autonomous "dark factory" to "software factory" after adding human-in-the-loop decision points.

Every coding agent in the factory runs through an Archon workflow, his open-source harness builder that manages git worktrees.

A GitHub webhook triggers a Neon function that stores every issue and PR in Postgres as a single audit trail.

The dashboard uses Neon Realtime, currently in public beta, to turn SQL queries into live-updating data.

Medin says he is open sourcing the entire software factory, with the SDLC workflow pack shipping by default in Archon.

Tools mentioned

Techniques

  • Human-in-the-loop escalation, where agents bubble a minimal set of owner decisions up to a person
  • Complexity-based dynamic workflows that run different steps depending on issue difficulty
  • Git worktrees to run multiple coding agents in parallel
  • GitHub webhook to serverless function ingestion into a Postgres database
  • Realtime SQL query subscriptions to drive a live dashboard
  • Database branching to roll back or compare versions of the factory
  • Auto-generated regression test scenarios selected per pull request
  • Storing every agent turn, tool call, and decision for retroactive debugging
Transcript (captions)

0:00 Throughout this year, I've spent an insane amount of time working on my AI software factory, the system where I can send in any issue ticket, even an entire release, and it plans it all out and

0:10 then builds it in an autonomous loop with all the verification that I need and human in/ne the loop where I want it. As you can imagine, it takes a lot to make this kind of autonomous system

0:21 reliable. That's why I've been spending so much time on it, especially with the hopes that I can give you a starting point so you can use this kind of system without having to go through all the

0:30 growing pains that I did. And I'm still working on evolving this constantly. And so what I want to do right now is give you a tour of everything that I'm working on to help me manage and evolve

0:40 my software factory because I've been putting a lot of time into building this mission control dashboard that I think you'll find really cool and hopefully inspirational as well. So, this video is

0:49 going to be a bit more unstructured than usual. You can think of this kind of like a devlog, but also I have a lot more to it that I want to show you because just generally what I'm working

0:59 on now, I've seen the industry shift towards recently. All the companies I'm seeing that are building software factories at scale, they always end up creating some kind of dashboard like

1:08 this to manage the system. Cuz a factory is a living and breathing machine. Even if you make something really reliable from the get- go, you have to constantly evolve it as you change your process and

1:18 what you're building. And so today, I'll quickly go through a lot of the different components that I have of my dashboard here. Like this is the full at a glance view of the software factory

1:27 workflow down to all the individual skills that I run through my agents. We can look at the key decisions that I've made over time as I've improved my factory. We can look at the individual

1:36 laps for each one of the factories I have running here. Like there's two I have hooked up into this dashboard. We have the individual decisions that we make when the factory brings things to

1:45 us. The highle decisions that need our attention. A lot of why I've built a lot of this is because I've found through all my testing and working with companies and implementing these

1:55 systems, the only way to truly make this reliable is if we have some things that bubble back up to the human to decide. And so it's all about how can we have the minimal set of decisions for the

2:06 human that gives the most amount of control possible. We want things to be running as autonomous as we can, but it can't fully be a dark factory. At the start of this year, when I built my dark

2:18 factory, it was the kind of system where there was no human in the loop at all. I built this all in public. I've covered this on my channel before, but my initial goal with the dark factory,

2:28 which I've renamed the software factory because I have added human in the loop, is you could give a PRD, just a highle description of what you want to build. You barely had to do any planning with

2:38 the agent and then it would just go through everything autonomously. So it split the whole PRD into issues, go through each one with its own verification steps and code reviews and

2:48 then it would just merge everything straight to production. This is sort of the dream with generative AI where it's reliable enough where you can go from idea all the way to fully shipped and

2:58 validated code like no human in the loop anywhere, not even for the merge. And as much as this can work for some things like proof of concepts, it's really not enough. I've had to dial back the

3:10 autonomy and add more human in the loop, which is what I've gotten to now with my software factory. Like this system here that I'm now managing with the dashboard is what I found to truly work. Now, to

3:20 be honest, initially I really didn't like the idea of having this kind of control plane over the software factory cuz I thought it would make it so that things are less autonomous and I have

3:28 more of a responsibility to manage things. But I've built it in a way where it's very easy to look at things at a high level and it really does help me drive improvements to the factory and

3:39 managing things as they are running and it's really the only way to manage the complexity of the factory. I've worked hard to make things simple and it's pretty easy for me to manage things now

3:50 but there is a lot that goes on under the hood. I mean, think about it. We have to manage dependency mapping, running things in parallel to really scale it, figuring out how we set up the

3:58 app validation for each piece of software we create, how we manage the staging environment, all the places we have human in the loop. And so having a system like this to really help us keep

4:07 track of things as they're running, bubbling up the decisions in a nice view instead of just always living in the GitHub issues like I was before. I mean, this is making a big difference for me.

4:17 I've built my own second brain and it helps me with a lot of my work, but it only works for me. So, for this part of the video, I partnered with Victor, the AI employee our whole team shares. When

4:27 someone on my team needs to know what's been decided or what's on their plate, they can't ask my second brain. They have to ask me and wait for my answer, at least until Victor. So, now Victor

4:36 lives in our Slack. And for example, before every team call, we can have him draft the agenda, pull what's stuck in Jira, take a look at what's merged in our archon repository, look at our open

4:46 questions in our threads, and for any decisions that we make in the call, we can just drop it right there for Victor. And then after the call, anyone on the team can ask Victor to turn our

4:55 decisions into Jira tasks, or at least that's how my team works. And so here, I did it exactly as a teammate would. And so he drafted the agenda earlier, and then I gave him the decisions, told him

5:05 to make Jira tasks. And so he proposed them, I approved, and now I have them as new tasks in Jira. My teammates used to wait 4 and 1/2 hours on average for me to get everything in Jira after a

5:16 meeting. But now no one has to wait for me, and it gets done in a couple of minutes. Victor is an AI employee that lives in Slack or Teams and is connected to over 9,800 tools. And he does the

5:28 actual work instead of just answering questions about it. And because he's shared, anyone on my team can hand real work to him, not just me. If you want to hire Victor for yourself, go to

5:37 victor.com for $100 of his work for free running in minutes. Use my codeen 100 and my link is in the description. And so, as you probably guessed, I am also using the software factory to build this

5:51 dashboard. So, the mission control, this option in the dashboard is the application itself that you're looking at right here. And it's also really nice because as I make my factory better and

6:00 better, it's going to make this dashboard better and better, which in turn makes it easier for me to manage the software factory. So, it's this nice flywheel where it's almost going to

6:09 become sort of self-evolving over time, which I'm really looking forward to. I mean, I just got started building this. Before I had this dashboard, I was managing everything directly in GitHub,

6:19 which kind of worked cuz I would have PR comments for the owner decisions and I could look directly at the merges to see how my labs are doing and things like that. But this is definitely a lot

6:29 better. And so, yeah, let me show you around a little bit. Now, the number one thing that I wanted for the homepage of my system, what you're looking at here, is a highle visualization of my entire

6:38 factory. All of the decision points, all of the individual skills. Before I had this, it was hard for me to picture in my head the shape of the factory. So in turn, it was also difficult for me to

6:48 understand how to evolve things as I wanted to make my factory better. So this has been a gamecher for me. So I also want to cover the underlying infrastructure for the factory. How

6:58 everything's stored in a Postgress database and I'm using archon to drive it all. I'll get to that in a little bit, but first I want to blitz through a tour of all the different sections that

7:07 I have of the dashboard. So, the first thing that I wanted after the main visualization is a tab to list the key decisions that I made for my software factory as I've evolved it over time

7:17 because I talk to my coding agent when there's issues that come up in the factory and I think about like how can I make the factory better and I want to document all of that so I don't go back

7:25 and try the same things that I've already tried and I also want to see what improvements are currently being tested. So there's all these different ideas I have for different changes I

7:33 want to make to my skills or different steps I want to add and I can manage the testing of all that here and go and look through everything I've changed already. Like the very first key decision that I

7:42 made is using archon for everything. We'll talk about that in a little bit. And then for all these decisions that I make, obviously they produce different versions of my factory in source

7:51 control. So I have all the different commits and I can take a look at the diff here between any two versions that I pick. And so I can see between these two versions, here's what's different

8:00 with the workflows, the steps, the underlying prompts, and the skills that I'm using for these steps. That's been very useful as well. I also have the overlying health of the dashboard. So

8:09 whenever there's a failure, what caused it? Twice, it was because I hit my rate limits with clawed code. And out of the hundreds and hundreds of laps that I've been running over the past couple of

8:17 weeks, 21 of the failures were because of issues within the workflows that I had to adjust. I also have a couple of tabs here to manage the ongoing runs of each individual software factory. So

8:27 these two tabs are custom depending on the factory that I select. And so I gave it a PRD. I split it into tickets. And that's what we're looking at here. I'm working on doing more grouping. There's

8:37 not too much grouping right now, but you can see a couple of instances here. For this release, I've worked on most of the issues already. So there's a couple that need my attention. That gets to the

8:47 owner tab we'll talk about in a bit. And then these three blue ones are the ongoing laps. And so this one's in the middle of reviewing the pull request. These two are currently in

8:55 implementation. And then I can also look at the laps here to get more details on, you know, the step it's on and the key decisions that have been made like the complexity of the task. My factory is

9:04 dynamic. It does different steps depending on how complex the issue is cuz we don't want to spend too much time on the really simple stuff and we don't want the factory to just be a basic

9:14 build and validate for the really complex stuff. So, we'll talk about the owner tab in a little bit with the key decisions that bubble up to us. The scorecard is really cool. It shows for

9:23 this current version of the software factory, how many laps have we run, how many merges have we had in this specific code base, how long has this been going for. These are the key metrics that I

9:33 look at to see if I need to make improvements to this factory version, and what improvements I should make. And then for the testing here, these are all of the scenarios that it devises for

9:43 regression testing and testing each feature as it's building out the codebase. And so I can also take a look at which ones it's deciding to run cuz obviously for every PR, we're not going

9:52 to run every single one of these. And also the success and failures for all of them. And then I have the record of all the versions and what changed for each one of them, at least what the core

10:00 changes are. And then I have the rewind, which this is something newer I'm working on as well. It's using the branching in neon which is what I'm using for my backend and my Postgress

10:10 solution. And so this allows me to actually go back to different versions of the software factory if I want to roll back or just test more on that version to compare to what I have right

10:20 now. So let me go back to the live branch. And with that, that's the high level of my dashboard. I know that some of these things might be specific to me, but I hope you can take inspiration from

10:29 a lot of these ideas for how I'm building in this observability and this easier way for me to manage the whole system. And so with that, let's talk a bit more about the underlying

10:38 infrastructure for the dashboard and the factory itself. You'll also notice here a lot of different mentions of Archon. Archon is my open- source harness builder. It allows you to take any AI

10:49 coding process and turn it into a reusable workflow and it handles a lot of the more difficult things with agentic engineering under the hood like work trees. So we can very easily manage

10:57 things in parallel. So this is the backbone of my entire software factory. A lot of people ask me how archon plays into it. Basically there's not a single coding agent executed in my factory that

11:08 is not done so through an archon workflow. All of this is just a collection of archon workflows that together drive the entire factory. all the planning, all the implementation,

11:19 all the validation. And so going into the Archon UI, which is separate, we can see all of the individual runs all the way down to the level of the logs for each run. So we have full observability

11:30 here. And my dashboard also links to this whenever we want to click into any individual step within each lap of the factory. Now, usually for this level of detail, you're going to have your agent

11:40 dig into it, but I'm just showing that everything really is running Archon under the hood. My co-author of Archon, Raasmus, has put an insane amount of effort building all of the workflows

11:50 that run my factory. It's here in the SDLC pack that ships default to Archon. And you could click into any of these, and I know you'll be impressed with every single one of them. There's so

11:59 much care that's gone into each one of these workflows. And everything running in the factory is using one of these for each step. And the beauty of Archon is everything that we can observe down to

12:09 the individual levels of the agents tool calls and turns and decisions it's made is all stored in a Postgress database. So I have my Archon hooked up here to Neon. And so everything that happens in

12:20 my software factory is stored here. So I have full audit trails and I can also digest this later to figure out things that went wrong and make improvements to my software factory that way. Cuz if I'm

12:31 not storing every agent turn and decision and tool call, I don't really have a way to know how things went wrong or why they did when I want to go back retroactively and figure out ways to

12:41 evolve my factory. So everything that goes on in Archon, everything that I'm seeing here in my dashboard is stored in Neon. For example, one of the things that used to be difficult for me to

12:51 manage is all the owner decisions. So questions for me, blockers that need my attention. It's important to have this cuz it's not a dark factory. We need some human in the loop when the agent

13:00 deems it necessary. But before it was kind of difficult for me to manage things. Here's an example of what it looked like before I had the dashboard. I would have my agent mention me in

13:10 either an issue or poll request. That was my key that it's my time to go in and resolve the issue, answer the question either by talking to my manager agent or posting a comment here in the

13:21 issue or PR. And that worked. But then I had to watch the repository closely or look out for those email notifications when I mentioned or the Slack alerts I had set up. It was okay, but I want to

13:32 manage everything in one place. Not just the owner decisions, but everything happening in my repository both for things that need my action and just for my observability. And so what I've done

13:41 is I've taken advantage of Neon's functions, which is a part of their new backend with authentication, object storage, functions, AI gateway. I mean, it's incredible. There's a reason I use

13:50 Neon for everything now. And so specifically for functions here, I have a GitHub web hook that triggers a function whenever there is a new GitHub issue or pull request. And because I

14:00 manage my entire factory with issues and PRs, that means that I now have a single entry point to process everything that's happening in my factory and store that in the Neon Postgress database. And

14:12 because my archon runs are also stored in the Postgress database, I have a central place for literally everything for all observability and when I want to dive into things with my agent to make

14:21 improvements to the system. And if we go to the monitoring for the neon function, we can see every single minute there is a lot going on in my factory as all these labs are running in parallel. And

14:30 the way that my dashboard is able to receive this information so quickly as everything is changing is by taking advantage of Neon's new real time which is in public beta right now. It makes

14:40 any SQL query live data. So I have these different SQL queries hooked up into my dashboard. So it's pulling all this information as things are happening with the underlying Archon workflows. And so

14:51 obviously I don't really want to get into the weeds with the code here, but just showing you an example of what it looks like to run one of these queries with Neon real time. So this is one of

15:00 the SQL queries that my dashboard runs and we can see the data come in in real time. Like there we go. We had a couple of new records that just came in. So, as things are happening with new pull

15:10 requests, new issues, new comments, whatever it is, the dashboard is able to get that right away and display it to me. So, I don't just have a record of things, I can also watch things as

15:20 they're going live, which is especially helpful as I'm working on improving my software factory itself. So, that's the dashboard in the factory at a high level to give you some ideas and inspiration.

15:31 And I just want to keep you up to date with what I'm working on here because the software factory is the big thing that I'm pouring so much time into right now and I'm giving it all to you. I'm

15:39 open sourcing this entire thing so you can use the factory to build any software that you want while I work under the hood on making this more and more reliable using the dashboard to

15:49 help me do so. Now, if you want to build your own software factory, you don't want to lean on my repository or neon or postgress or whatever, that's okay. Even if you just want to take my resources as

15:58 a starting point, I would encourage you to do that. But obviously, if you want the most power out of the box, there's a reason why I'm building this as an open- source project, and I would encourage

16:08 you to use Neon. You need some kind of backend to store and process everything. It's not enough for it to just all live in GitHub. I mean, there's a reason why I've been partnered up with Neon for so

16:17 long. And I'll have a link to them in the description. And so with that, if you found this interesting, you're looking forward to more content on my software factory and agentic

16:25 engineering, I would really appreciate a like and a subscribe. And with that, I will see you in the next video.

Frontier News · by Hyperjump Technology