Seedlabs

PatchSplit: file-scoped decomposition for multi-file agent tickets

A tool that breaks large coding tasks into a sequence of small, single-file changes for AI agents.

PatchSplit is a middleware that breaks a multi-file engineering ticket into a dependency-ordered sequence of small, file-scoped subtasks — each with interface stubs and its own compile-and-test gate — so a coding agent makes one small, verified change at a time instead of one large, ambiguous patch. A hybrid planner (a Tree-sitter/LSP symbol graph plus a single LLM planning pass) decides the order and writes the stubs between steps, and any failing step can be retried or rolled back on its own.

Computer ScienceSoftware Engineering Research
Reasoning and Retrieval OptimizationPlatform engineers at mid-sized SaaS companies running legacy API migrations — for example, replacing a deprecated internal RPC client across hundreds of service files — use PatchSplit to turn the migration ticket into ordered, individually tested steps that a human maintainer reviews and merges one at a time.
Explainer video — the idea and its research foundation. Scripted and voiced by GLM and Piper · 24 Nov 2026.
Watch with transcript →

Concept

A runtime layer in front of any coding agent that turns one large multi-file ticket into a sequence of small, winnable steps:

  1. Plan — decomposition is a hybrid of static analysis and one LLM planning pass, not free-form generation:

    • Index. Tree-sitter parses the repository into a symbol graph — definitions, imports, and call/reference edges — and a language server (LSP) supplies precise references and error checks.
    • Map. One LLM planning pass reads the ticket plus the symbol-graph neighborhood of the modules the ticket touches, and proposes which files change and how they group into subtasks (target: a handful of files per subtask, around three — a tunable design parameter, not a measured optimum).
    • Order. Subtask order comes from a deterministic dependency-first sort of the static graph — things that are depended on get built first — not from the LLM. Files that depend on each other in a cycle are collapsed into the same subtask, so the plan cannot stall on a circular dependency.
    • Stub. For every new or changed interface, the planner emits a stub — signatures, types, a one-line contract, and a failing test — committed before the subtasks that depend on it. LSP diagnostics check every call site against the stub, a cheap pre-gate in front of the full compile/test gate.

    The planning pass is deliberately thin: its output is a sequence to execute and recover from, not a standalone specification deliverable — the product is the gated execution loop below.

  2. Execute — dispatch each subtask to the agent of choice with only its scoped context; run compile and test gates after every step.

  3. Recover — on gate failure, retry the step, re-plan the remainder, or roll back that single step rather than the whole patch. Step-level diffs and logs record what changed between the failing and last-passing attempt, so failure is attributed to one step — the same credit-assignment problem MARS addresses with comparative reflective memory, which distills lessons from differences between solutions [3].

  4. Merge — assemble verified steps into the final patch, with a per-step audit trail for human review.

Why now

  • CodeS shows that decomposing repository generation into a multi-layer sketch — directory structure first, then file sketches, then function details — is a “simple yet effective” way to generate an entire repository from natural-language requirements [1]. That is direct evidence that layered, file-scoped decomposition is a workable pattern, though for greenfield generation rather than edits to existing code.
  • A survey of code-enhanced reasoning argues that code is a structured medium for reasoning precisely because it provides verifiable execution paths, enforces logical decomposition, and enables runtime validation — the properties PatchSplit's per-step gates rely on — and that reasoning “translates high-level goals into smaller executable steps” [2].
  • MARS manages complex research repositories with a Design-Decompose-Implement pipeline and reaches state-of-the-art among open-source frameworks on MLE-Bench; notably, its planning is budget-aware, explicitly balancing performance against execution expense [3]. Decomposition has to be costed, not just structured — so PatchSplit logs per-step token and wall-clock cost from day one.
  • Skywork-SWE (existing source) shows capable SWE agents already sustain more than 50 interaction rounds and contexts above 32k tokens, so a sequence of scoped steps sits well inside demonstrated operating limits.

Honest limits and open questions

  • The evidence is adjacent, not direct. CodeS generates new repositories and MARS automates ML-engineering tasks; neither measures how agent performance varies with the number of files edited in an existing repository. PatchSplit's core premise — that small, immediately-verified steps beat one large attempt on multi-file tickets — is a hypothesis to validate on a pilot set of real tickets, not a proven curve.
  • Stub overhead. Generating and maintaining interface stubs costs planning effort, and stubs can drift from the final implementation. CodeS's cheap intermediate sketch layers and MARS's cost-constrained planning suggest the overhead is manageable when each step is small, but it must be measured per deployment.
  • Cost inflection. Many small scoped calls could cost more than one large-context call. MARS's budget-aware planning exists because this trade-off is real [3]; per-step cost logs make any inflection point visible.
  • Trust and audit. Intermediate repository states contain stubs and failing tests by design. The per-step audit trail and single-step rollback are the mitigation; whether human reviewers accept stubbed intermediate states remains open.
  • Plan-phase error. If the planner mis-groups files or misses a dependency, downstream steps inherit the error. Step-level logs make the correlation between planning mistakes and final success measurable — the first thing a deployment should instrument.

Written by GLM · 24 Nov 2026 · revised 1× with new research (latest 24 Nov 2026, Gemma 4 and GLM)

AI assessment

Backed by 6 papers86

A highly focused, technically grounded middleware that solves the 'multi-file failure' problem in AI coding by enforcing a dependency-ordered, stub-gated execution sequence.

Evidence strength
4/5
The idea directly addresses the 'sharp performance drop' for multi-file patches noted in SWE-Bench Pro and applies the decomposition patterns from CodeS and MARS to a specific editing problem.
Market pull
5/5
Platform engineers managing legacy migrations have high urgency and budget for tools that reduce the risk of breaking large-scale internal APIs.
Novelty & moat
3/5
While SpecCompiler provides the 'what' (specs), PatchSplit provides the 'how' (execution sequence and gated stubs), filling a gap in the execution lifecycle.
Feasibility
4/5
Leveraging existing LSP and Tree-sitter tools makes the symbol graph and stub-checking feasible, though the 'hybrid planner' requires careful tuning.
Wedge clarity
5/5
The focus on legacy API migrations across hundreds of files is a sharp, high-value entry point that avoids the 'general agent' trap.
Simplicity / focus
5/5
The product is a focused middleware layer with a single clear purpose: decomposing and gating multi-file tickets.

Scored by Gemma 4 · 24 Nov 2026. Rated against a fixed rubric (evidence, market, novelty, feasibility, wedge, simplicity), relative to the closest ideas already in the catalog. A prior estimate to compare ideas before real-world signal arrives.

Act on this idea

Ideas only matter if someone runs with them. Your message goes straight to the founder's inbox — nothing is stored on our servers.

Business analysis

The SWOT analysis reveals that PatchSplit leverages a strong technical foundation in static analysis to solve the 'monolithic patch' problem, but faces a critical hypothesis risk regarding whether decomposition actually improves agent success rates. While it aligns with current trends in modular agentic workflows, its commercial viability depends on balancing the increased token cost of multiple scoped calls against the reduction in failure-driven retries.

Strengths4

Weaknesses4

Opportunities3

Threats3

Essential for evaluating the internal technical hypothesis (small steps vs. large patches) against the external opportunity of the growing AI agent market. · Generated 2026-11-24 by Gemma 4AI-generatedFull SWOT Analysis →

Who benefits

  • Its open-source agent stack collapses on 10+ file tasks (near-zero resolve in the benchmark); a decomposition middleware directly lifts its worst-performing regime for enterprise users.

  • Factory AIcompany

    Sells enterprise coding droids for large codebases where multi-file changes are the norm; verified, incremental subtasks with gates match its long-running autonomous workflow pitch.

  • Could embed decomposition so Cursor's agent takes on large refactors it currently fails, converting the measured file-count cliff into sequential wins.

  • Stripecompany

    Payments monorepo changes span many files under strict reliability requirements; per-step compile/test gates with rollback provide a reviewable audit trail for compliance-sensitive patches.

Research it builds on

  1. SWE-Bench Pro: Can AI Agents Solve Long-Horizon Software Engineering Tasks?
    Xiang Bo Deng, Jeff Da, Edwin Pan et al. · 2026 · 510 citations
    All ideas from this paper →
  2. CodeS : Natural Language to Code Repository via Multi-Layer Sketch
    Daoguang Zan, Ailun Yu, Wei Liu et al. · 2026 · 51 citations
    All ideas from this paper →
  3. Code to Think, Think to Code: A Survey on Code-Enhanced Reasoning and Reasoning-Driven Code Intelligence in LLMs
    Yang, Dayu, Tianyang Liu, Daoan Zhang et al. · 2025 · 48 citations
    All ideas from this paper →
  4. Skywork-SWE: Unveiling Data Scaling Laws for Software Engineering in LLMs
    Liang Zeng, Li, Yongcong, Xiao, Yuzhen et al. · 2025 · 41 citations
    All ideas from this paper →
  5. MARS: Modular Agent with Reflective Search for Automated AI Research
    Jiefeng Chen, Bhavana Dalvi Mishra, Jae Hyun Nam et al. · 2026 · 39 citations
    All ideas from this paper →
  6. Code to Think, Think to Code: A Survey on Code-Enhanced Reasoning and Reasoning-Driven Code Intelligence in LLMs
    Dayu Yang, Tianyang Liu, Daoan Zhang et al. · 2025 · 35 citations
    All ideas from this paper →
Leave feedback
feasibility