SwiftRelay

← All sprint notes

First Lap: Long Refactors with GPT-6.1 Sol

Model splitsEN

Give GPT-6.1 Sol a bounded refactoring lane

A long refactor changes how code is organized without intentionally changing what it does. Think of moving payment logic out of route handlers, replacing scattered configuration reads, or splitting an oversized module. The danger is not just broken syntax. It is an accidental behavior change buried inside a patch that looks tidy.

For this first run, use GPT-6.1 Sol for the ongoing refactoring work and keep GPT-6 Astra for difficult questions that block progress. Treat this as a workflow choice, not a guarantee about either model. Your tests, review process, and repository rules remain the authority.

Set the finish line before changing files

Start on a clean branch with a working test command. Record any existing failures so they do not get confused with regressions. Then write a short task brief that defines the boundary of the work.

  • Goal: Move invoice total calculations from route handlers into a dedicated module.
  • Unchanged behavior: Preserve rounding, tax ordering, error responses, and public interfaces.
  • Excluded work: No dependency upgrades, formatting sweeps, or database changes.
  • Evidence: Run focused calculation tests and the relevant route tests after each slice.

Ask GPT-6.1 Sol to inspect the relevant files and propose a plan before editing. Require it to identify callers, tests, and uncertain assumptions. A useful plan names concrete files and a small first patch, rather than promising to clean up the entire architecture.

Run GPT-6.1 Sol through small, reviewable slices

Long work does not need one enormous prompt or one enormous diff. Give each slice a narrow purpose: extract a helper, update one caller, or remove an unused path after its replacements pass testing.

A practical instruction is: “Extract the invoice calculation into a dedicated module. Preserve existing behavior and public interfaces. Change only the files required for this extraction. Explain any uncertainty before editing.”

After each slice, inspect the diff and run the relevant checks. If your coding tool can execute commands, request the commands and their results. Otherwise, run them yourself. Do not treat a statement that tests passed as evidence unless you can inspect the output.

Commit accepted slices separately. Maintain a short progress note with completed changes, remaining callers, test results, and unresolved questions. When you start a fresh session, provide that note alongside the current repository state rather than relying on a long chat history.

Make a GPT-6 Astra pit stop for a specific blocker

Escalate when the next step requires a decision, not merely more editing. Examples include conflicting tests, unclear transaction boundaries, or a helper whose callers depend on different error behavior.

Give GPT-6 Astra a compact investigation packet: the original goal, relevant code, failing test output, constraints, and the exact question. Ask it to separate observed facts from assumptions and propose the smallest experiment that would resolve the uncertainty.

For example: “These callers handle rounding differently. Which existing behavior does each test protect, and what additional test would expose a regression during extraction?” Review the answer before adopting it. Return the decision and supporting evidence to GPT-6.1 Sol so the main refactor continues with an explicit constraint.

Connect the refactoring workflow through SwiftRelay

SwiftRelay is a practical relay for using both models through compatible coding tools or an OpenAI-compatible SDK. Its API host is https://api.fastapirelay.com; OpenAI-compatible SDKs use https://api.fastapirelay.com/v1 as the base URL. Configure credentials through your tool’s supported secret mechanism, not in committed source files.

Sign up for SwiftRelay to try this workflow with a small new-account gift credit. Billing is per token, so keep investigation packets focused and review usage as the refactor grows.

Finish the refactor with evidence, not a clean-looking diff

Before merging, run the broader checks required by your project, review public interfaces, and remove temporary scaffolding. Compare the final patch against the original task brief. The finish line is preserved behavior with a clearer structure—not simply fewer files or a confident model response.

Keep reading

Back for another lap?Log in