We built a harness for PARTYstation, a live party-game platform: tests, documentation and rules wrapped around the working system so that coding agents could rewrite it without breaking anything in production. In three months agents rewrote more than 300,000 lines of backend from PHP and Node to Python, the platform moved to a new cloud, and on 31 August 2026 production traffic switched over. New features now ship from a single full-stack developer working with agents.
PARTYstation is a platform for party games. The game runs on a big screen, a TV at home, a birthday, a corporate event, and players join from their phones as controllers: quizzes, charades, associations, meme rounds. Around ten game types, up to a few dozen players in a room, web-TV, mobile apps, Android TV, Samsung, and the same games embedded in the Kinopoisk and Wink streaming services. The platform earns through subscriptions and paid games, so every interrupted game hits revenue directly.
By the time we joined, the platform had been in production for more than four years and had grown into a zoo of stacks: a PHP REST API of about 150 thousand lines, Node.js game servers holding a websocket to every phone in the room, a separate statistics service, five client apps. The streaming partners ran on a fork of their own: at the end of 2023 the whole system was copied for them, and over two and a half years the copies drifted apart, so features and fixes were carried between them by hand and much of the work was done twice. Over half a million lines across a dozen repositories, no up-to-date description of how it all fit together, and technical debt growing faster than features.
What such legacy costs showed up on New Year’s Eve, the busiest night of the year. A series of Quiz Battles brought about 1,200 players online at once, and the main server choked. Restarts made it worse: the shared cache went down with them, and some players lost their results mid-game. The fire was put out with hardware; the cause was never found, because there was nothing to find it with.
The deploy was a shell script nobody fully understood anymore: it ran git reset --hard in each repository on bare-metal servers and restarted the live processes.
Until then the platform had been run by an in-house team of about six people. The company parted ways with it and chose not to assemble a new one: it changed the development model itself, and now a small group of engineers runs the product through coding agents. The bet paid off, and then some: today new product features ship from a single full-stack developer working with agents.
Our job was to build what makes that model possible. We call it a harness: the scaffolding around the code that lets an agent understand someone else’s system, avoid harming it, and carry a task to completion with minimal human involvement.
Agents wrote the code and the tests, kept the documentation and did the digging in the old system. People decided what to build and in what order, set the architecture and the rules, talked to the client, and were responsible for everything that got merged and for acceptance. Product calls, and the judgement of what counts as a bug, stayed with people the whole way.
There was documentation, but it was scattered: a wiki of a few dozen pages, mostly about content and processes, and an API description that in places disagreed with the code. It couldn’t tell you how the system worked as a whole. We read our way into the repositories and took whatever the code couldn’t answer, mostly product questions, to the client’s team. A technical description grew around the live system: an architecture map across all the repositories, the modules and integrations, how a game travels from the big screen to the phones and back. Only then did we move on.
That description couldn’t be the acceptance criterion: a product company won’t sign off technical documentation for what looks to them like an internal reshuffle. So the reference became the system itself, the code on their production branch and how it responds right now. The rewrite had to pass the same regression as the original: a check that can run at any moment and never goes stale.
None of this required a feature freeze. The client’s team kept shipping into the old stack the whole time, 37 commits by the end of July, including two new modules and changed contracts, and we carried all of it over.
That decision is where the whole method comes from. It fits into five steps.
Every backend service moved to one language, so there is one stack to hold, and services share code where it helps: the message contracts are defined once and used on both sides of the wire. We took the current versions of everything: Python 3.13, uv for the monorepo, FastAPI, Pydantic v2, async SQLAlchemy.
The move to Kubernetes alone could have been done on the old code. What the rewrite bought was the stack: refactoring would have kept two languages and a forked backend, with no tests to refactor against. One stack also made the code reusable: message contracts and shared configuration are written once and used by the API, the game server and the statistics consumer. And Python is where coding agents do their best work, in our experience and in recent benchmarks: on Multi-SWE-bench and Amazon’s SWE-PolyBench, agents resolve Python tasks far more often than TypeScript ones, the obvious alternative for a Node game server.
The timeline demanded as much parallel work as possible, between people and between the agents each person runs. We cut the roadmap into tasks small enough for an agent in a fresh chat, each in two halves: the code and the tests.
The tests were written against the legacy, so nobody waited for anybody. The halves met only at the merge, under a strict rule: code goes in only together with tests that pass on both the old system and the new one. We called this rule legacy parity, and the machinery that checks it, the tests, the two stands and the agent skills around them, the parity oracle.
With its own worktree and its own stand for every agent, nothing heavy ran on the developer’s laptop, and one engineer could keep around ten agent sessions going at once.
The “old” stand was our own copy of the legacy, which nobody had written down how to assemble. We brought it up on new infrastructure, since the platform was moving from bare metal to managed Kubernetes anyway. The test doesn’t know which stand it runs on: a divergence between the stands is the error signal.
What to test came from a coverage map our QA engineer wrote with the client’s team: every user scenario in the product, split into domains and ranked from critical paths like login and payment down to cosmetics.
We test on three levels: unit tests for business logic with everything external faked, API tests against a running server with a real database, and end-to-end tests in a real browser via Playwright.
The hardest level is a real-time game: dozens of players per room and, in a Quiz Battle, many rooms in one match, all over websockets. One scenario spins up isolated browsers for the big screen and the phones, plays the real game protocol and checks what every participant sees. Nothing is mocked; the only concession in the product is markup identifiers for the tests.
Tests weren’t the only gate: every pull request also goes through an AI reviewer tuned to this project. It sees the whole repository along with the harness and checks against its own rulebook of almost two hundred lines, the same one our internal review follows, and the agents work through its comments until it approves. It catches local defects well, but a divergence from the old behavior can’t be seen in a diff: that is what the two stands are for.
Trust here comes from the checks. Every change passes the type checker, the linter, the layer rules, an AI reviewer and the test suite on both stands, and nothing merges without green required checks and another person’s approval. The result is about 6,500 automated tests and one structure across the whole codebase, which is more than the hand-written original ever had.
On the outside, the system’s behavior is a contract: the endpoint’s response, its status, and the side effects other parts of the system depend on. We hold it one to one. On the inside we rebuild cleanly, without carrying the old shortcuts into the new code.
Side effects matter as much as responses: database writes, audit-log rows, calls to neighboring services, cache invalidation. The admin login, for example, writes a log row with a specific category, level and message. We write these out for every endpoint, otherwise a naive rewrite silently loses them.
The same line decides what happens to the hundreds of bugs we found along the way. A bug that clients and internal jobs already depend on is carried over as is. An internal inefficiency nobody sees from the outside is rebuilt cleanly.
A request with an unknown content type gets a 200 instead of an error: the old mobile app relies on it, and a fix would break live clients.
The game list for the game server was rebuilt from the database on every request, 14–26 seconds each, and when its cache expired every room asked for it at once. The new code builds it in about 3 seconds and keeps it in a shared cache.
Every defect goes into a ledger in the repository, each written up well enough for an agent to fix it later. A fix goes in right away only where the risk of breaking something is below a threshold agreed with the client up front. Everything else is carried over as is, and the entry explains why.
The inside didn’t have to follow the old structure either. The statistics service, a separate PHP application with its own admin panel and API, was folded into the main API, leaving one event consumer and a nightly report builder instead of three daemons. Its consumers kept the same contracts and never noticed.
The main trap surfaced on the very first module, authorization: after a day of reading PHP, the agent wrote Python in Laravel’s style, with no layers at all, and the module had to be refactored. What we needed from the old code was its behavior, so the main agent looks into the legacy only through an archaeologist sub-agent: read-only, returning a short summary with line references and a mandatory account of side effects. The old files never reach the main context, and the new architecture doesn’t drift toward the old one.
Our own code follows strict rules: each service has a layering instruction with a decision table for where new code goes, dependencies point one way, and a change that doesn’t fit the layers stops for a question instead of inventing a new one.
The same rules damp the models’ habit of over-engineering: no abstract interfaces with a single implementation, no silent defaults for a missing setting. The harness started on that first module with 2 skills, 5 rules and a single hook; by the end of the port it held 32 skills, 23 rules, 7 sub-agents and 3 hooks.
The old platform’s monitoring was what the hosting provider gives out of the box: CPU, memory, disk. Not one application metric, not even errors by status code.
Logs from every pod go to Loki, the game server publishes its own metrics, and the API and the game server send traces to Tempo, so one trace follows a player’s action from the websocket down to individual database queries. Ingress tags every request with its status code; it all lands on 13 dashboards of our own, with alerts to the team’s messenger.
People open the dashboards; agents read the same metrics, logs and traces from the terminal, and by now most of the digging goes through them.
Yes, on purpose: agents cut releases and read production logs, metrics and traces, which is how one developer keeps up. An agent never merges or deploys anything on its own, only on a person’s explicit command, and months of daily work have shown that this holds up. Every merge into the main branches needs another person’s approval, which nobody can skip, and a green run of the required checks: the linter, the type checker and a security scan. The harness rules keep production read-only unless a person says otherwise, a hook stops plaintext secrets from landing in the repository, and any release can be rolled back with one workflow.
On our own contour the move was gradual: nginx in front of the legacy copy sent each rewritten group of REST endpoints to Python, and one line of config could send it back to PHP. The game server couldn’t move like that: a room keeps its live state and its players’ websockets in memory, so it was rewritten whole and swapped in one move.
By early August the last PHP endpoint was gone from our contours. The client checked the new system by hand against the old one, and acceptance took eight working days.
Production was switched over all at once. With the whole system visible in Grafana, we switched everything in one evening and watched. On 31 August the legacy jobs stopped, the databases and media moved to the cloud, payments and our own jobs were switched on, and only then did DNS go over. The order mattered: the billing jobs charge the moment they come up, and a mistake there would have charged cards twice.
The first billing run went through without a single error, and the few small things that surfaced in the following days took a couple of minor fixes.
Everything moved, live traffic included. More than 300,000 lines of legacy backend (the REST API, the game servers, statistics, the background jobs and the streaming partners’ fork) were rewritten in about three months, production traffic moved from the old system to the new one without stopping the product, and it all now runs as one Python codebase, on new infrastructure, inside the harness.
| Before | After | |
|---|---|---|
| Backend | PHP and Node.js across a dozen repositories | Python, one monorepo |
| Infrastructure | Bare-metal servers | Managed Kubernetes in the cloud |
| Deploy | A shell script with git reset --hard | A release from a tag: build, migrate and deploy in about ten minutes, with a rollback |
| Observability | Hardware metrics only | Application logs, metrics and traces in Grafana, with alerts |
| Tests | A manual regression checklist | 1,486 scenarios in the coverage map, about 6,500 automated tests |
| Dev environments | Shared stands on one shared database | An isolated stand per branch, with its own databases |
| Who ships features | A team of about six people | One full-stack developer with agents |
That last row is the point: work that needed a whole team is now done by one full-stack developer with agents, and the platform never stopped earning along the way.
A single full-stack developer with agents, inside the harness, where the old system took a team of about six people. The code is ordinary Python with no framework of ours, and Python developers are among the easiest to hire. The harness is plain Markdown in the same repository: the architecture document, rules, skills and the bug ledger. We built it for Claude Code, as agreed with the client, but also ran it with other agents, including Codex, Cursor and Grok: they work with it fine and adapt it to their own conventions.
The port rested on legacy parity, and parity had a shelf life: after the cutover, production itself became the reference.
The harness was rebuilt for product work: a feature travels from a product spec through a technical design to code, each step with its own skill, and the client’s product team already writes specs with it.
More than a hundred pull requests have been merged into the main branch since the cutover, and each product has its own release cycle cut from a tag. The first major feature on the new system was a new game genre: fundamentally new mechanics, its own game engine, and changes to the design system on both the big screen and the phones. On the old system it would have taken deep involvement from the people responsible for its architecture and about a year of work. On the new one it was built in two weeks.
After the cutover the infrastructure was resized against 30 days of load metrics: orphaned disks and images were removed, Redis and the dev cluster were scaled down, and for the same setup the cloud bill dropped by about 22%.
The same release also runs in a second cloud: the international, English-language PARTYstation deploys from the same images and chart to a separate Kubernetes cluster on DigitalOcean in Frankfurt.
The method doesn’t depend on the source language. The reference is the old system’s behavior seen from outside, so the tests talk to its API and never import its code, and the archaeologist reads PHP, Java or C# equally well. It works best with the old system running on a stand: here nobody had written down how to assemble it, and we worked that out ourselves. Without a stand the method still works, but with one the agent can run the old code and check what actually happens on top of reading it. Beyond that it needs someone who knows the product to answer questions.
We will tell you whether the task fits AI agents and, if it does, outline a concrete plan.
Inquiry sent
We will reply within one business day to the email you provided.
or write directly to ilya@manaraga.ai