Code Generation

Preview

Comprehension-first changes that fit the codebase they land in.

Generation is the last phase, not the first. Pimsy reads the surrounding code, the callers and the tests before it writes anything.

Change pipeline#

  1. 1

    Locate

    Find the true target among candidates: the active implementation, not a deprecated copy.

  2. 2

    Trace

    Follow callers, state ownership and tests that cover the current behaviour.

  3. 3

    Plan the diff

    Decide the minimal set of edits and what must remain unchanged.

  4. 4

    Implement

    Apply edits in the existing style — same error handling, same module boundaries.

  5. 5

    Prove

    Execute and test. A change without evidence is not complete.

  6. 6

    Report

    Summarize what changed, what was intentionally not changed, and residual risk.

Diff discipline#

RuleReason
No opportunistic refactorsUnrelated changes make review and bisection harder
No reformatting untouched linesFormatting noise hides the real change
No new dependency without justificationDependencies are a long-term cost the reviewer inherits
Comments explain *why*, not *what*The code already states what it does
Public contracts change only when askedSilent API changes break consumers
ts
const task = await pimsy.tasks.create({
  projectId: class="tok-str">"prj_checkout",
  objective:
    class="tok-str">"Guest checkout fails with a null tax profile for EU addresses. Find the root cause, " +
    class="tok-str">"fix it minimally, and add a regression test that fails before the fix.",
  completion: {
    criteria: [
      class="tok-str">"A test reproduces the failure before the change",
      class="tok-str">"Full suite passes after the change",
      class="tok-str">"Diff touches no more than class="tok-num">3 files"
    ]
  }
});

Last updated 2026-09-12