# AI-native engineering in open source

> Sierra is piloting an interview where engineers improve a draft pull request in an existing codebase with coding agents. Five of my merged open-source fixes show how I do that work, from finding a broken invariant to proving the fix.

By Andy Wang · 5 Dec 2026 · https://www.wangyaodi.com/blog/ai-native-engineering-in-open-source

Written with AI from my merged open-source pull requests and Sierra's interview post, checked against GitHub. See "How this post was made" at the end.

This is the Markdown copy of the post, for AI tools and agents. The web page has the diagrams and charts; here each one is described in words.

---

On 22 April 2026, Sierra published [The AI-native interview](https://sierra.ai/blog/the-ai-native-interview). They removed their coding and algorithm interviews and replaced them with an AI-native onsite: candidates plan a product, build it with the AI tools of their choice, then review it with the interviewers. Because that onsite tests building from zero, Sierra also began piloting a debugging interview for taking a feature “from 1->N in an existing, messy codebase”: candidates get a medium-sized codebase and a colleague's draft pull request, then review and improve it while iterating with coding agents.

Much of that pilot looks like my working days. From 16 September to 4 December 2026, upstream maintainers merged 223 of my pull requests across 12 public Ruby and AI repositories, part of the 241 merged pull requests across 20 projects on my [open-source page](https://www.wangyaodi.com/oss). Most are reliability fixes in code I did not write: concurrency races, savepoint rollbacks, stale background jobs and stream shutdown order. One difference matters, though. In open source I choose the problem and cut its scope myself. A candidate in Sierra's round inherits a colleague's draft of a cross-cutting feature with the scope already set, and has to work out what the author intended before deciding whether to repair the approach or replace it.

**In short:** Sierra is piloting a debugging interview: improve a colleague's draft pull request in an existing codebase while working with coding agents. Five of my 223 recently merged open-source pull requests, in Rails, ActiveAgent, RubyLLM, Lewsnetter and MCP Ruby SDK, show the workflow I use for that kind of work: find the broken invariant, pivot when the first design fails, judge AI review suggestions, and prove the fix.

- 223 merged PRs across 12 repos, 16 Sep to 4 Dec 2026
- 5 upstream repositories examined in detail below
- 103 changed lines of production code across those 5 PRs
- 466 changed lines of tests and changelog across those 5 PRs

This post follows those four steps in order. If you only have a minute, this image summarizes it:

![Summary of the post. AI-native engineering in open source: four steps from five merged pull requests. 1, Find the invariant (Rails #59442, Lewsnetter #80): a savepoint rolled back by a commit callback must also roll back on the main connection, and a queued newsletter must still be due when the worker claims it. 2, Pivot when it fails (ActiveAgent #664, MCP Ruby SDK #709): a row lock failed on SQLite under Rails 7.2, so one conditional UPDATE replaced it; reordering session teardown was written up with its trade-off. 3, Judge AI suggestions (RubyLLM #1676): Greptile and CodeRabbit found the same gap and proposed different fixes; the merged fix checks hidden names before File.lstat. 4, Prove the fix: force the race in a test, revert each guard and watch a test fail, and say what was not run; two workers held at a barrier executed a run twice before the fix and once after. Across the five PRs, 103 changed lines of production code against 453 of tests and 13 of changelog.](https://www.wangyaodi.com/assets/blog/ai-native-engineering-in-open-source/summary.jpg)

*The post in one image. [Open it full size](https://www.wangyaodi.com/assets/blog/ai-native-engineering-in-open-source/summary.jpg) to save or share it.*

## What the debugging round is looking for

**In short:** Sierra wants interviews to capture initiative, ownership, judgment and system understanding. In an existing codebase with coding agents in the editor, I read that as four habits: find the rule that breaks, change course when the first design fails, keep judgment over AI output, and prove the fix.

Sierra lists what it wants its interviews to capture: “initiative, ownership, judgment, system understanding, and product thinking.” It also explains why the old screen no longer fit: “vibe-coding an app is easy. The harder, more relevant, problem is getting it into production in a scalable way.” In the onsite, agency comes down to one question: “do they pivot when they get stuck?” For the debugging round, Sierra says the level of AI allowed is still undecided, because new models can zero-shot many fixes.

In an existing codebase with coding agents in the editor, I read that as four habits:

- **Problem framing and system understanding:** finding where a rule breaks across layers instead of patching the symptom at the surface.
- **Agency:** changing course as soon as a database, protocol or CI matrix rejects the first approach.
- **Judgment over AI output:** using agents to map code, draft tests and critique a diff, then deciding which suggestion is right.
- **Ownership through verification:** backing a small change with reproductions, mutation checks and a plain list of what was not tested.

Working in 12 codebases I did not write over 80 days pushed me to make those habits repeatable. Each pull request goes through the same loop, with a clear line between what I hand to an AI tool and what I check myself.

> **Figure 1. The four steps of this post as one loop. AI tools speed up mapping, scaffolding and critique; choosing the bug, the design and the fix, and proving it, stay with me.**
>
> Four-step workflow for fixes in an existing codebase, separating AI assistance from my own judgment.
>
> Four steps from left to right, matching the four sections of this post. Step 1, Find the invariant: trace one rule across a queue, lock or stream; AI maps the call graph and sibling paths; I isolate one bug and split off side findings. Step 2, Pivot when it fails: let CI and older adapters break the first design; AI finds existing patterns in the repository; I switch designs and name the trade-offs. Step 3, Judge AI suggestions: AI reviewers attack the diff and propose fixes; I pick the fix that needs the least and prove it with a test. Step 4, Prove the fix: forced races, mutation checks and stated limits; AI drafts the test harness and checks the PR description against the diff; I revert each guard and report the gaps.

## Find the broken invariant (Rails #59442 · Lewsnetter #80)

**In short:** Pick one rule the project already promises and follow it across a boundary where time, concurrency or another process can change it. In Rails the boundary was a connection proxy; in Lewsnetter it was the queue between the scheduler and the worker.

People ask how to find bugs worth fixing in a repository you cloned ten minutes ago. I don't hunt for style cleanups or speculative refactors. I pick one rule the project already promises and follow the state across a boundary where time, concurrency or another process can change it.

In Active Record, a savepoint lets an inner transaction roll back while the outer one keeps its writes. While working on a separate Rails pull request (`#59440`), I found a case in the then-unreleased Ractor connection handler. When a `before_commit` callback raised while a savepoint committed, the proxy left that savepoint open on the main connection. `TransactionManager#commit_transaction` had already popped the savepoint, so `rollback_savepoint_transaction` no longer saw it as `current_transaction` and skipped the main-side rollback. The savepoint's writes stayed visible, and the main side ended up one transaction deeper than the proxy.

I kept it out of `#59440`: I opened issue `#59441` and a focused pull request, [rails/rails#59442](https://github.com/rails/rails/pull/59442). The hard part was deciding whether the main connection still owed a rollback, because after a failed savepoint release it has already rolled back. Comparing transaction depths tells the two cases apart. I chose depths over savepoint names because the main side can use a `RestartParentTransaction`, which has no savepoint name. The fix added 6 lines and deleted 5 in `abstract_proxy_adapter.rb`, and both new tests fail on `main`. Ryuta Kamizono of the Rails core team merged it two days later, without review comments.

The same habit works in application code. In [bborn/lewsnetter#80](https://github.com/bborn/lewsnetter/pull/80), the boundary was the queue between scheduling a newsletter and sending it. `ScheduledCampaignDispatchJob` checked that a campaign was due and had an audience, then enqueued `SendCampaignJob`. By the time a worker picked the job up, an editor could have moved the campaign back to draft, postponed it, or removed its segment. `SendCampaignJob` only checked `sendable?`, so it sent anyway; with the segment gone, it could mail the whole list.

The fix carries the scheduler's intent across the queue. The dispatcher passes `from_scheduler: true`, and under the existing claim lock the worker rechecks all three rules before sending. Manual sends and resumes don't pass the flag and behave as before. A job queued before the deploy has no flag either, so it keeps the old check: the change doesn't break jobs already in the queue, but it doesn't protect them. Bruno Bornsztein merged it the same day, after adding a test and simplifying the claim branch on the PR, and wrote:

> Reproduced #79 on master: a queued send still went out after cancel or postpone, and mailed the whole list once the segment was removed. All three skip with this. I added a test for the next-tick unschedule and folded the duplicated claim branch. Manual sends had the same stale-queue gap, so master now re-checks the audience on every claim (d3ab5be). Merged, thanks.

The last part matters: once the rule was written down, the maintainer saw the same gap in manual sends and closed it on `main` in [a separate commit](https://github.com/bborn/lewsnetter/commit/d3ab5be9b0a9c1391013c138b826b0c4f8551b56).

> **What it taught me:** You don't need months of a repository's history to find bugs that matter. Trace one rule across a boundary (proxy to main connection, enqueue to worker, file write to directory scan), state the expected result as something you can observe, such as zero deliveries after a postpone, and split every unrelated defect into its own pull request.

## Pivot when the first design fails (ActiveAgent #664 · MCP Ruby SDK #709)

**In short:** A pattern copied from a nearby file is a hypothesis, not a fix. When Rails 7.2 CI broke a row-lock claim in ActiveAgent #664, I switched to one conditional UPDATE. In MCP Ruby SDK #709, I reordered teardown and wrote the new trade-off into the PR.

Sierra's question about agency is “do they pivot when they get stuck?” In an existing codebase, being stuck rarely means you can't write the Ruby. It means your first plausible fix runs into a database engine, an older framework version, or an ordering constraint you didn't see on the first pass.

### When copying the local pattern broke on Rails 7.2

In [activeagents/activeagent#664](https://github.com/activeagents/activeagent/pull/664), `AgentExecutionJob` read a run's status and then wrote `running` as two separate steps. Two workers that both loaded the same run as pending each started a generation: a second billed provider call and repeated tool effects.

My first commit (`56b3fb56`) claimed the run under `run.with_lock`, the way `AgentResumeJob#claim_pause` already claimed paused runs. CI's `rails7.gemfile` job showed why that wasn't enough. SQLite under Rails 7.2 opens deferred transactions, so when two claims overlap, the loser's write after its locked read is refused once the winner commits. The duplicate started no generation, but instead of declining it raised `SQLite3::BusyException` (“database is locked”).

> **Figure 2. The pivot in ActiveAgent #664. The row lock failed loudly on SQLite under Rails 7.2; the conditional update lets exactly one worker proceed. The PR tested the job on SQLite with Rails 7.2 and 8, plus a separate PostgreSQL 17 probe of the SQL statement.**
>
> How two ActiveAgent workers compete to claim a pending run, before and after the pivot.
>
> First design, commit 56b3fb56: with run.with_lock, two overlapping claims under SQLite on Rails 7.2 could leave one worker unable to write after the other committed, and the duplicate raised SQLite3::BusyException. Revised design, commit b3e7406a: both workers attempt one write that sets the run to running only if it is still pending. One changes a row, reloads the run, broadcasts its status and starts execution. The other changes zero rows and returns before starting execution.

Thirty minutes later, commit `b3e7406a` replaced the lock with one conditional `update_all`, the way `CodeSessionJob#start` already claims a session elsewhere in the repository. The database decides at the write, and the affected-row count tells the worker whether it won. Because `update_all` skips callbacks, the winner reloads the run and broadcasts the status change itself:

```ruby
# actionagent/app/jobs/action_agent/agent_execution_job.rb (#664)
def claim_pending(run)
  now = Time.current
  claimed = AgentRun.where(id: run.id, status: AgentRun.statuses[:pending])
    .update_all(status: AgentRun.statuses[:running], started_at: now, updated_at: now)
  return false if claimed.zero?

  run.reload
  run.broadcast_update
  true
end
```

Two tests pin the race down. In the first, two threads on their own connections are held at `AgentRun.find` by a barrier until both have loaded the run, so the race happens on every run without sleeps: two executions before the fix, one after. In the second, a forked process claims the run, signals through an `IO.pipe` that it holds the claim, and keeps it uncommitted for 0.3 seconds while the job tries to claim. That test fails with the `with_lock` version on Rails 7.2 with CI's `database is locked` error and passes with the conditional update on Rails 7.2 and 8. The PR reports both concurrency tests stable over 20 runs on each version.

For PostgreSQL, the app's test schema doesn't load, so a standalone probe of the same statement on PostgreSQL 17 stood in: one winner in each of 50 forced races. One gap stays open on purpose. A worker that dies after winning its claim leaves the run `running`, and recovering it needs a lease. I named that in the PR as a separate decision instead of folding it in.

### Naming the trade-off when reordering teardown

Sometimes the pivot is about order rather than data access. In [modelcontextprotocol/ruby-sdk#709](https://github.com/modelcontextprotocol/ruby-sdk/pull/709) (a follow-up to `#692` and `#698`), ending a stateful HTTP session ran teardown in the wrong order. `cleanup_session_unsafe` woke threads waiting on nested server-to-client requests with `:session_closed` before their requests were cancelled, and `release_session` closed the GET and POST streams before calling `cancel_all_incoming`. Closing a stream on a stalled peer can take up to `stream_write_timeout:` (10 seconds by default), and in-flight requests kept running behind it.

I reordered teardown: cancel the session's requests first, wake the remaining waits second, close the streams last, all still outside `@mutex`. The PR measured `main` (`00868f7`) against the branch with a GET stream whose `close` blocked until released:

| During session DELETE | Before #709 | With #709 |
|---|---|---|
| Incoming SSE request while stream close blocks | The tool ran (`cancelled?` false) and its result was written to the POST stream | The tool never ran; nothing was written |
| Request waiting on nested elicitation | `RuntimeError` (`cancelled?` false), recorded as `error: :internal_error` | `MCP::CancelledError` (`cancelled?` true), recorded as `cancelled: true` |

Every ordering change moves the risk somewhere. Here, a blocking `on_cancel` hook can now delay the stream closes, where before a stalled close left requests running. I wrote that trade-off into the PR's Breaking Changes section and said where the PR could be split in two if the maintainer preferred. Koichi ITO merged it the next day.

> **What it taught me:** When a constraint breaks your first approach, don't patch around it with retries or sleeps. Capture the failure in a test, switch to a mechanism that satisfies the constraint, and tell the reviewer exactly what trade-off the new design introduces.

## Use AI review without outsourcing judgment (RubyLLM #1676)

**In short:** Coding agents and AI reviewers are good at mapping code, drafting tests and finding edge cases. In RubyLLM #1676, two AI reviewers found the same real gap in my first commit and proposed different fixes. The work left to me was choosing one, and proving the choice.

Coding agents such as Claude Code, Codex and Antigravity do real work in every repository I touch. They are strongest in three places:

- **Cold-start mapping:** tracing call paths across an unfamiliar repository and finding sibling sites once one bug pattern shows up. Once check-then-act appeared in `AgentExecutionJob` (`#664`), the same check found it in `AgentRun#cancel!` (`#672`) and `ScenarioEvaluationRunner#call` (`#713`).
- **Mechanical scaffolding:** drafting test harnesses and reproduction scripts, and checking PR descriptions against the actual diff.
- **Adversarial critique:** a second agent, or an automated reviewer such as CodeRabbit or Greptile, attacking my first commit to look for races I missed.

Where AI use goes wrong is treating a suggestion, or a passing patch, as the end of the thinking. [crmne/ruby_llm#1676](https://github.com/crmne/ruby_llm/pull/1676) is a small example of the decision that remains.

In RubyLLM, `FileStore::Directory#list` walked a chat's folder with Ruby's `Find` and called `File.lstat` on each path. The store's own `#write` writes a hidden temporary file and renames it into place, and `#list` doesn't take the store's lock. In a loop of writes on one thread and listings on another, about 4% of listings hit `Errno::ENOENT` between `Find` reading the folder and `File.lstat`. The outer rescue turned the whole listing into `[]`, telling the model the chat had no files.

My first commit (`ed046017`) skipped a name that raised `Errno::ENOENT` or `Errno::ENOTDIR` and carried on. Within four minutes of the PR opening, two AI reviewers found the same gap in it. If a hidden folder vanished at `File.lstat` and was recreated before `Find` checked it again, skipping with `next` also skipped `Find.prune`, so `Find` could descend into the folder and list its visible children. They proposed different fixes: [Greptile](https://github.com/crmne/ruby_llm/pull/1676#discussion_r4576516088) suggested moving the hidden-name check before `File.lstat`, and [CodeRabbit](https://github.com/crmne/ruby_llm/pull/1676#discussion_r4576519520) suggested calling `Find.prune` inside the rescue.

> **Figure 3. RubyLLM #1676: two AI reviewers, one finding, two fixes. The merged commit took the earlier name check and added a regression spec for the hidden-folder case.**
>
> Two AI review suggestions for a hidden-folder race in RubyLLM pull request 1676.
>
> The review case: a hidden folder vanishes at File.lstat and reappears before Find descends into it. Greptile proposed pruning hidden names before File.lstat, since the name alone decides the answer. CodeRabbit proposed pruning the entry when File.lstat fails, so Find skips it and its children. The merged change, commit 2b74112f, checks the name first, then calls File.lstat on visible entries and skips ENOENT or ENOTDIR, so the listing still returns the other visible files.

Both suggestions fixed the reported case, so the question was which one needed less. A hidden name decides by itself that a path should be pruned; no `File.lstat` call is needed. Checking the name first fixes the recreated-folder case, and it also means the hidden temporary files that `#write` creates, the source of the original race, are never read at all. Pruning inside the rescue acts only after the lookup has already failed. Minutes after the reviews, commit `2b74112f` moved the check, kept the narrow rescue for visible paths, and added a spec for the hidden-folder case. CodeRabbit then approved.

```ruby
# lib/ruby_llm/file_store/directory.rb (#1676)
Find.find(start) do |path|
  next if path == root

  Find.prune if File.basename(path).start_with?('.')
  stat = File.lstat(path)
  files << stored_file(path, stat) if stat.file?
rescue Errno::ENOENT, Errno::ENOTDIR
  next
end
```

The production change is three added lines and one deleted. The 49 lines of specs change the folder from inside a `File.lstat` stub, once, right before the walk reaches a name: a deleted file, a temporary file renamed into place, a folder replaced by a file, and a hidden folder that vanishes and comes back. None of them depends on timing, and all four fail on `main`.

> **What it taught me:** AI reviewers are fast mappers and sharp critics, but when two of them disagree, the choice is still yours. Ask what information each fix needs: if the name alone decides the case, doing file I/O first only adds another way to fail. Then write the spec that proves the choice.

## Make verification the deliverable

**In short:** Across the five PRs, 103 changed lines were production code and 466 were tests and changelog. Tests that force the bug, mutation checks and plain statements of what wasn't tested are what earn a maintainer's trust.

When a coding agent can draft a 15-line patch in seconds, the patch alone proves little. What convinces a maintainer who doesn't know you is the evidence around it.

Across the five pull requests, counting additions plus deletions from GitHub (including the maintainer's commits on Lewsnetter #80), 103 changed lines were production code and 466 were tests and changelog: 453 test lines and 13 changelog lines. My earlier posts found the same pattern: 130 library lines against 534 of tests and docs in [RubyLLM's MCP client](https://www.wangyaodi.com/blog/learning-mcp-by-fixing-rubyllm), and 854 code lines against 2,170 of tests and docs in [ActiveAgent and Lewsnetter](https://www.wangyaodi.com/blog/production-ai-in-rails-is-background-job-engineering).

> **Figure 4. Changed lines (additions plus deletions) from GitHub across the five pull requests. Tests and changelog account for 466 of 569 changed lines.**
>
> Lines added plus removed across five merged pull requests, production code against tests and changelog.
>
> Horizontal stacked bar chart of changed lines (additions plus deletions) for five pull requests across five repositories. Rails #59442: 11 production code, 31 tests (42 total). ActiveAgent #664: 32 production code, 180 tests and changelog (212 total). RubyLLM #1676: 4 production code, 49 tests (53 total). Lewsnetter #80: 21 production code, 118 tests (139 total). MCP Ruby SDK #709: 35 production code, 88 tests (123 total). Combined total: 103 lines of production code and 466 lines of tests and changelog (569 total).

| Pull request | Repository | Production lines | Test & changelog lines | Merged |
|---|---|---|---|---|
| [#59442](https://github.com/rails/rails/pull/59442) | rails/rails | 11 (+6/-5) | 31 tests | 1 Nov 2026 |
| [#664](https://github.com/activeagents/activeagent/pull/664) | activeagents/activeagent | 32 (+26/-6) | 167 tests + 13 changelog | 31 Oct 2026 |
| [#1676](https://github.com/crmne/ruby_llm/pull/1676) | crmne/ruby_llm | 4 (+3/-1) | 49 tests | 16 Nov 2026 |
| [#80](https://github.com/bborn/lewsnetter/pull/80) | bborn/lewsnetter | 21 (+16/-5) | 118 tests | 22 Nov 2026 |
| [#709](https://github.com/modelcontextprotocol/ruby-sdk/pull/709) | modelcontextprotocol/ruby-sdk | 35 (+21/-14) | 88 tests | 23 Nov 2026 |

The ratio is a side effect of five habits I run before opening a pull request:

1. **Make the bug happen on every run.** Force the bad interleaving with a synchronization point or a stub instead of hoping a sleep lines it up: a `Concurrent::CyclicBarrier` at `AgentRun.find` in ActiveAgent `#664`, a `File.lstat` stub in RubyLLM `#1676`, a stream whose `close` blocks until released in MCP Ruby SDK `#709`. Where a second process needs a timing window, as the forked worker in `#664` does, keep it short and rerun it: that PR reports 20 stable runs on each Rails version.
2. **Mutation-check every piece of the fix.** Before calling a PR done, I revert each condition, guard, reload or ordering change in turn and confirm a test fails. In ActiveAgent `#664`, reverting the status condition failed 7 tests, the reload 1, the broadcast 1 and `started_at` 2. In Rails `#59442`, forcing the depth to either value, ignoring it or dropping the nil default each failed a test. In Lewsnetter `#80`, disabling the scheduler branch or any one of its three checks failed a test. In MCP Ruby SDK `#709`, closing the streams before cancelling failed both new tests. In RubyLLM `#1676`, removing the rescue, dropping either error class or moving the name check back after `File.lstat` each failed a spec.
3. **Say what must stay the same, and test it where you can.** Lewsnetter `#80` tests that a manual send of a due campaign still sends. In MCP Ruby SDK `#709`, an existing test still checks that a pending request unblocks when its session is cleaned up. RubyLLM `#1676` states that a permission error still ends the listing.
4. **Report exact test runs and honest gaps.** In Rails `#59442`, I listed 10,195 runs on `sqlite3` and 9,460 on `sqlite3_ractor`, named the one local error in each that needed the `pg` gem, and wrote that PostgreSQL and MySQL were not run locally. In ActiveAgent `#664`, I noted that the test schema did not load on PostgreSQL and ran the standalone probe on PostgreSQL 17 instead.
5. **Write for a reviewer who has five minutes.** Lead with the broken invariant, show measured before-and-after output, state any ordering or scope trade-off up front, and keep one pull request to one change.

> **What it taught me:** A mutation check is the fastest cure for AI-generated test theater. If you can delete a line of your fix and the suite still passes, either the line is unnecessary or the test never proved it.

## Six habits to steal for your own codebase

**In short:** Whether you maintain a company Rails app, review a colleague's draft PR, or sit in an AI-native debugging round, the same six habits apply.

You don't need to contribute to open source to practice this. Each habit carries over to reviewing a teammate's pull request or hardening a production service:

1. **Start from one invariant, not a symptom.** Ask what promise breaks across a queue, lock, transaction or process boundary. (Rails #59442, Lewsnetter #80)
2. **Reproduce deterministically before editing production code.** Replace sleeps with barriers, pipes or targeted stubs so the test fails on `main` every run. (ActiveAgent #664, RubyLLM #1676)
3. **Pivot fast when real constraints push back.** When CI, another database engine or an older Rails version cracks your first design, keep the failing test and swap the mechanism. (ActiveAgent #664)
4. **Use AI as mapper and critic, and keep the decision.** Let agents find sibling call sites and attack your diff. When their suggestions differ, ask what each fix needs to know, and test the one you pick. (RubyLLM #1676)
5. **Mutation-test every guard you add.** Revert each condition and side effect one by one; if nothing fails, strengthen the test or delete the code. (All five PRs)
6. **State trade-offs and untested gaps in the PR description.** Honest limits speed up review more than a claim of total coverage. (Rails #59442, MCP Ruby SDK #709)

Sierra's redesign reflects what teams now need from senior engineers: someone who can drop into an existing system, use AI tools with discipline, change course when reality disagrees with the first plan, and leave changes that are smaller, clearer and better tested than what was there. My [open-source page](https://www.wangyaodi.com/oss) breaks down all 241 merged pull requests by project. If you're hiring for that kind of role, start with [my hire-me page](https://www.wangyaodi.com/hire-me); if you want this kind of review on your own codebase, see [AI & codebase audits](https://www.wangyaodi.com/ai-audits).

## Limits worth knowing

**In short:** Five selected pull requests illustrate a repeatable workflow for existing codebases. They are not a controlled study, they don't cover building a product from zero, and in each one I chose the problem instead of inheriting someone else's draft.

- **Selected examples, not a study:** I chose these five from the 223 merged in that period because each shows a decision you can inspect in a diff, a review thread or a test. They don't measure merge rates, the time AI tools saved, or how often these bugs occur in deployed apps, and they don't mean every fix needs a 4.5-to-1 test ratio.
- **Choosing the problem is not inheriting it:** In open source I pick bugs with a clear boundary, an explicit invariant and an observable result, and split side issues into separate pull requests. Sierra's round hands you a colleague's draft with its scope already set. Recovering another person's intent and deciding whether to repair or rewrite their approach is a different skill, and these examples show it only in part: the pivot in ActiveAgent `#664` replaced my own first design, not someone else's.
- **1-to-N debugging is only half of Sierra's process:** Open-source bug fixes exercise system understanding, debugging, scoping and verification well. They don't replace 0-to-1 product framing, customer conversations or owning a product roadmap over years.
- **Local environments still have blind spots:** Rails `#59442` was not run on PostgreSQL or MySQL locally, and ActiveAgent `#664` covered PostgreSQL with a standalone probe of one statement. CI matrices and targeted probes close part of that gap, not all of it.
- **AI capabilities keep moving:** Sierra says the level of AI allowed in its debugging interview is still undecided, because new models can zero-shot many fixes. The durable skill is not a particular prompt or tool; it is framing the invariant, checking constraints and proving the fix.

## Read this with an AI

This post is structured so you can walk through it with a chat assistant or apply its checklist in your own repository with a coding agent. A plain Markdown copy, without the page around it, lives at [`/blog/ai-native-engineering-in-open-source.md`](https://www.wangyaodi.com/blog/ai-native-engineering-in-open-source.md). Chat assistants and coding agents such as Claude Code or Codex can read it straight from that address.

**In short:** A Markdown copy of this post, made for chat assistants and coding agents, is at [`/blog/ai-native-engineering-in-open-source.md`](https://www.wangyaodi.com/blog/ai-native-engineering-in-open-source.md). The full post has ready-made prompts for learning the workflow and reviewing a draft PR.

Or start from one of these prompts. The first works in any chat. Run the other two inside a coding agent such as Claude Code or Codex in your own repository.

**Walk through the workflow (chat)**

```text
Read https://www.wangyaodi.com/blog/ai-native-engineering-in-open-source.md and walk me through its four steps using the five open-source pull requests: one section at a time, in plain words, with one question for me after each section before you move on.
```

**Review a draft PR like a maintainer (coding agent)**

```text
Read https://www.wangyaodi.com/blog/ai-native-engineering-in-open-source.md and review the current git diff against its six habits. Check: (1) which invariant the change touches and where the code acts on it, (2) whether a check-then-act race, an ordering bug or a database-adapter constraint can break it, (3) whether a sibling call site has the same gap, and (4) whether a simpler fix sits one step earlier. Give me one failing case and one ordinary case that should keep working, and cite exact file paths and lines before editing anything.
```

**Mutation-check our fix (coding agent)**

```text
Read https://www.wangyaodi.com/blog/ai-native-engineering-in-open-source.md. Inspect the tests for our current branch and list every condition, guard, reload, or ordering change in the production diff. For each one, tell me which test would fail if that line were reverted, flag any timing-dependent sleep, and propose deterministic barriers or stubs where coverage is missing. Do not modify production code until I review the plan.
```

## How this post was made

I wrote this post with AI, and every post here says how it was made. The pull requests, code, tests and commit histories behind it are my own public work on GitHub, together with the reviewers' suggestions and maintainers' commits that went into them. Here is who did what:

- **Sources:** Sierra's [The AI-native interview](https://sierra.ai/blog/the-ai-native-interview) (22 April 2026), my open-source record ([`/oss`](https://www.wangyaodi.com/oss), 241 merged PRs across 20 projects), and the five merged GitHub pull requests listed under [References](#references), with their review threads.
- **Draft:** Antigravity drafted the text, the four inline SVG diagrams, the share card and the one-image summary from those sources.
- **Checks:** On 5 December 2026, Codex reviewed the draft against GitHub and caught three errors: the early hidden-name check in RubyLLM #1676 was Greptile's suggestion, the forked-process test in ActiveAgent #664 holds its claim with a short sleep, and jobs queued before the Lewsnetter #80 deploy keep the old check. Claude Code then rechecked every PR description, commit time, review comment, merge record, per-file line count, quote and code excerpt against GitHub and Sierra's post the same day, and the totals against `data/oss.yml`. Test results are as reported in the PRs.
- **Review:** I reviewed the first draft, asked Codex to review and revise it, and gave Claude Code the final editorial decision. I read the final version and approved it for publication on 5 December 2026.

If you find a mistake, tell me on X and I'll fix it here.

## References

**In short:** All five pull requests are merged and public on GitHub, alongside my [open-source record](https://www.wangyaodi.com/oss) and Sierra's [The AI-native interview](https://sierra.ai/blog/the-ai-native-interview).

My merged pull requests examined in this post:

- [rails/rails#59442](https://github.com/rails/rails/pull/59442) Fix Ractor proxy savepoint rollback after before_commit (merged 1 Nov 2026 by Ryuta Kamizono)
- [activeagents/activeagent#664](https://github.com/activeagents/activeagent/pull/664) Claim a pending run before executing it (merged 31 Oct 2026 by Justin Bowen)
- [crmne/ruby_llm#1676](https://github.com/crmne/ruby_llm/pull/1676) Keep listing a folder when one of its files vanishes (merged 16 Nov 2026 by Carmine Paolino)
- [bborn/lewsnetter#80](https://github.com/bborn/lewsnetter/pull/80) fix(campaigns): revalidate scheduled sends when claiming queued jobs (merged 22 Nov 2026 by Bruno Bornsztein)
- [modelcontextprotocol/ruby-sdk#709](https://github.com/modelcontextprotocol/ruby-sdk/pull/709) fix: cancel a terminated session's requests before closing its streams (merged 23 Nov 2026 by Koichi ITO)

External reference and related pages on this site:

- [Sierra: The AI-native interview](https://sierra.ai/blog/the-ai-native-interview) (published 22 Apr 2026, updated 12 May 2026)
- [Open-source record](https://www.wangyaodi.com/oss): counts by project, selected pull requests and GitHub links for 241 merged upstream pull requests across 20 projects
- [Learning MCP by fixing it](https://www.wangyaodi.com/blog/learning-mcp-by-fixing-rubyllm): nine RubyLLM MCP pull requests and the five-step runtime bug method
- [Production AI in Rails is mostly background-job engineering](https://www.wangyaodi.com/blog/production-ai-in-rails-is-background-job-engineering): twelve ActiveAgent and Lewsnetter pull requests on claims, leases, and server-side tool guardrails
- [Hire me](https://www.wangyaodi.com/hire-me): target roles, remote logistics from UTC+8, and evaluation links

---

Discuss this post on X: reply to [@yorzi](https://x.com/yorzi) with a link to https://www.wangyaodi.com/blog/ai-native-engineering-in-open-source
