A framework, named by Lalit Maganti in his syntaqlite post, for understanding when AI coding agents help and when they hurt. The frame is borrowed from physics: in any small local area, the laws of motion look simple and Newtonian. Zoom out, and spacetime curves in ways the local picture cannot predict. Code is the same. AI is excellent in the local frame, increasingly unreliable as you move to the global one.

Knowing where you are on these axes at any given moment is the core skill of working with AI effectively. — Lalit Maganti

The Two Axes

The framework has two independent dimensions. Both must be favorable for AI to be net-positive.

Axis 1: How well do you understand the problem?

ModeDescriptionAI behaviour
Deeply understoodYou know exactly what the right answer looks likeAI is excellent. You review output in seconds, catch mistakes before they land, iterate at a pace impossible alone.
Describable but not yet knownYou can articulate what you want and evaluate progress, but you don’t have the answer in your headAI is good but requires care. You must stay engaged and not just accept output.
Unknown desired outcomeYou cannot articulate what you wantAI is between unhelpful and harmful. You follow it down dead ends that feel productive in the moment but collapse under scrutiny.

In the syntaqlite project: parser rule generation lived in the first mode (Lalit knew exactly what each rule should produce). Learning Wadler-Lindig pretty printing for the formatter lived in the second (he could describe what he wanted, evaluate output, and learn from it). Designing the project’s overall architecture lived in the third (and is where he lost a month to vibe-coding).

Axis 2: Is the answer objectively checkable?

Even when you understand a task deeply, AI struggles if there is no objective measure of correctness.

  • Locally checkable: code compiles, tests pass, output matches a specification. AI excels here.
  • Not objectively checkable: design choices, architectural fit, API ergonomics, “is this pleasant to use,” “will this help users solve their problems.” AI does poorly, sometimes catastrophically.

Lalit’s clearest example: he spent several days in early March doing nothing but API refactoring, manually fixing mistakes any experienced engineer would have instinctively avoided. He understood the problem deeply — he is a senior engineer with years of API design experience. But there is no test for “is this API pleasant to use,” and so AI’s normal verification loop did not work, and the agent produced a mess.

The Relativity Metaphor

The physics analogy is not decoration. It captures the structural reason AI behaves this way:

  • At the level of a function or a class, there is usually a local right answer (compile, type-check, pass tests). AI is excellent at this scale.
  • Architecture is what happens when locally correct components interact.
  • You cannot get good global behaviour by stitching together locally correct components — exactly as you cannot reconstruct the curvature of spacetime from a series of small flat patches.

This is the structural failure mode of “vibe-coding.” Each individual diff looks fine; the codebase as a whole becomes unreasonable.

Practical Implications

When to lean on AI

  • Implementing a function with clear inputs, outputs, and behaviour
  • Generating tests for code with deterministic expected outputs
  • Writing CRUD, glue code, formatters, and other “obvious” code
  • Cross-domain learning where you need the fundamentals of a new framework or API
  • Refactoring at scale once the architectural target is set
  • Long-tail polish: docs, packaging, editor integrations, error messages

When to do it yourself

  • Defining the public API of a library
  • Choosing the boundaries between modules
  • Deciding the overall architecture of a project
  • Anything where the answer is “it depends on taste” and there is no objective check
  • The non-obvious core of the project — the part where the value comes from doing something the standard way would miss (Lalit’s parser architecture and extraction pipeline)
  • Any moment when you cannot articulate what you want clearly enough to evaluate output

Refactor as the steady-state

Because AI generates code at industrial scale, you have to refactor at industrial scale. Lalit’s rule after the rewrite: after every large batch of generated code, ask “is this ugly?” Either AI cleans it up (when the issue is local), or you give it the larger architectural direction and let it execute.

If you have taste, the cost of a wrong approach drops dramatically because you can restructure quickly. — Lalit Maganti

This inverts the usual advice. The “10x engineer” of the AI age is not the one who writes the most code; it is the one with the best taste who can recognize ugliness fast.

Why This Matters

The Relativity framework is a sharper version of the standard advice “use AI where it helps.” Most engineers eventually learn this through painful experience. The framework lets you predict, before starting a task, whether it will go well.

Two practical questions to ask before delegating to AI:

  1. Do I understand this task well enough to recognize a wrong answer in under a minute? If not, AI is risky.
  2. Is there an objective check that the answer is right? If not, AI is risky even if the answer is conceptually clear to me.

If both answers are yes, lean on AI hard. If either is no, slow down and engage your own judgment.

  • Local correctness vs architectural correctness — the heart of the framework
  • Taste as the bottleneck — connects to Taste for Makers (taste as the engineer’s most leveraged skill)
  • Industrial-scale refactoring — connects to the broader Vienna School of Agentic Coding insight that agent-friendly codebases require continuous reshaping
  • The deferred-design trap — Lalit’s slow-corrosion warning: cheap refactoring made design decisions feel deferrable, but deferring corroded clarity. See Building syntaqlite - Eight Years of Wanting, Three Months with AI for the lived example

Connected Pages