A coding agent can turn a vague modernization request into a large pull request faster than a team can establish what must not change. That creates a difficult responsibility for technical product builders: choosing the change, not just reviewing its implementation. An old invoice service might need a dependency upgrade, a clearer calculation boundary, or a replacement endpoint. Each can look reasonable in isolation. The defensible choice depends on the behavior customers rely on, the evidence available to protect it, and what recovery would actually require if the change goes wrong.
Harshith's Newsletter / Reader access
Continue reading.
Subscribe free to Harshith's Newsletter to read the rest of this article and unlock every blog and newsletter edition.
Confirm your email to read. Free. Unsubscribe anytime.We remember this browser for 180 days, unless you sign out or clear site data.Already subscribed?
GitHub’s November 25, 2026 modernization article gives this problem a concrete workflow. Sam Quakenbush describes assessing repository evidence before selecting a treatment, then encoding the repeatable procedure in a Copilot agent skill while retaining human architectural judgment. This is a publication date, not evidence of a new model release. The useful development is a reusable method for deciding what to authorize.
The practical extension is to treat modernization as a sequence of evidence-backed permissions. First authorize investigation. Then authorize behavior capture. Only then authorize one bounded production change. The worked invoice example below shows how to compare three candidates, separate facts from unresolved questions, and write acceptance criteria that an agent cannot satisfy merely by producing plausible code. The payoff is a decision worksheet that distinguishes a small diff from a small operational risk.
Modernization is a change-selection problem
Quakenbush’s source method considers whether a needed component should stay, be upgraded, have a dependency swapped, be wrapped, or be rewritten. Removal requires a separate check that the capability is unused or superseded and confirmation from its owner. The article explicitly describes this as a decision order, not a universal ranking of effort or risk. See GitHub’s component-level treatment guidance.
That distinction matters. Replacing a dependency can alter every request even if the edit touches two files. Extracting a function can touch several files while preserving the same runtime and persistence behavior. Conversely, a seemingly mechanical extraction can change rounding, exception timing, or mutable state. File count describes review surface. It does not describe customer exposure.
My recommendation is to choose the smallest change that satisfies a real requirement and has an acceptable evidence gap. Those are separate conditions. A well-tested refactor that solves no current problem may be unnecessary. An urgent security upgrade may remain necessary despite imperfect tests, but then the team must explicitly accept the remaining risk and provide compensating controls. Evidence should shape the decision, not become an excuse to postpone every difficult change.
Build an evidence ledger, not an architecture story
Begin with claims that could be disproved. Record the repository revision, file location, relevant command or observation, and what each item establishes. Separate the version declared in a manifest from the version resolved in a lockfile, and both from the runtime used by a deployed artifact. A configuration file is evidence of configuration, not proof that production follows it.
The GitHub method labels uncertainty as documented, inferred, or unverified. A useful addition is a separate execution record: environment, command, exit status, and retained output. This prevents documented instructions from being mistaken for successful execution. Structural mapping can accelerate the search for callers and dependencies, as discussed in the comparison of repository knowledge graphs, but a graph still needs checking against configuration, dynamic dispatch, and external consumers.
Unknowns should affect authorization. An unknown invoice-export consumer blocks an export-format change, but need not block adding isolated calculation tests. An unresolved runtime contradiction blocks a runtime upgrade proposal until someone checks the deployed image. Rather than marking the whole system unsafe, attach each uncertainty to the decisions it could invalidate.
| Claim | Evidence and status | What it does not establish | Decision affected |
|---|---|---|---|
| The service declares decimal library 2.x | Manifest declaration, documented; resolved version must be checked | Actual deployment version or compatibility with 3.x | Dependency upgrade |
| The invoice route calls calculateInvoice | Route and direct call site, documented | Absence of batch or dynamically loaded callers | Calculation extraction |
| Invoice exports appear to consume stored totals | Export query, inferred pending owner review | All consumers or historical backfill behavior | Changes to calculation and persistence |
| CI tests block merging | Unverified until repository rules are inspected | That a green workflow is a required gate | Any implementation authorization |
Find the strongest honest regression net
A broken test suite is not automatically evidence of a broken application. In Quakenbush’s reported PiggyMetrics investigation, five tests passed and nine errored; the errors traced to embedded MongoDB initialization. His narrower next step was to replace the test dependency and rerun the affected tests before changing the production stack. These are the author’s historical results, not tests performed for this article. The reported feasibility check did not establish that the whole application ran correctly.
Use a time-boxed feasibility check to determine whether the old component can produce meaningful evidence. Can dependencies install in an approved environment? Can the relevant component build? Can one representative workflow run without production credentials or side effects? Record failures separately from behavior mismatches. A missing database binary, a failing assertion, and an unavailable secret require different responses.
If the old path runs at an acceptable cost, capture its behavior before changing it. If it cannot run without modification, a thin supported slice may be the first practical experiment. In that case, documentation and domain review provide a weaker starting specification. Outputs frozen from the new implementation protect future consistency, but cannot independently establish parity with the old one.
Illustrative worked example: an invoice service
The entire example in this section is hypothetical. Imagine a Node.js invoice service with an HTTP creation endpoint, a monthly batch worker, a decimal arithmetic dependency, and a database table containing final invoice totals. The product requirement is to create a stable calculation boundary so that a later supported dependency upgrade can be evaluated without simultaneously changing routing and persistence. Assume no urgent vulnerability or support deadline forces the upgrade first.
The initial assessment finds a calculation function embedded in the invoice handler and a batch worker importing that function. The route writes invoice rows and emits a billing event. A hypothetical local feasibility run can execute the calculation function, but integration tests cannot start because their database setup is obsolete. Deployment runtime information remains unverified. The export query reads stored totals, but the finance owner has not yet confirmed every consumer.
Those findings support three candidates, but not equally. The team should compare what each candidate helps achieve, which behavior it can affect, and whether the present evidence can distinguish a successful implementation from a plausible one.
| Candidate | Benefit | Exposure and proof gap | Decision now |
|---|---|---|---|
| Upgrade the decimal dependency | Move toward a supported arithmetic library | Potential rounding and serialization changes in HTTP and batch paths; deployed runtime unverified | Investigate compatibility and runtime before authorizing |
| Extract the calculation module | Create one testable boundary for the later upgrade | Both callers affected; selected outputs can be compared with the unchanged implementation | Authorize baseline capture, then a constrained extraction |
| Rewrite the invoice endpoint | Replace routing and simplify request handling | Authentication, validation, persistence, retries, events, and calculations all exposed | Defer: not required for the stated goal |
Capture inputs and outputs before extracting
For this example, assume the old function accepts decimal strings and returns monetary strings with two decimal places. A hypothetical capture of the unchanged implementation yields the cases below. In a real project, execute that implementation to obtain expected values; do not ask the agent to invent them from the desired new code.
| Input | Existing output | Behavior protected |
|---|---|---|
| Two units at 19.95; 10% discount before 20% tax | Subtotal 39.90; discount 3.99; net 35.91; tax 7.18; total 43.09 | Operation order, rounding, and string formatting |
| Three separate lines at 0.05; no discount; 10% tax | Net 0.15; tax 0.03; total 0.18 | Tax rounds per line: each 0.005 becomes 0.01 |
| One credit line at -0.05; 10% tax | Net -0.05; tax -0.01; total -0.06 | Negative half-cent rounds away from zero |
| Zero-value line with zero tax | Net 0.00; tax 0.00; total 0.00 | Zero formatting and absence of negative zero |
The three-line case is particularly useful. Rounding tax once on the invoice gives 0.015 rounded to 0.02, producing a total of 0.17. Rounding each line gives tax of 0.03 and a total of 0.18. Both implementations could look sensible in review. Only an explicit contract identifies which behavior this modernization must preserve.
Add cases for empty input, malformed amounts, maximum supported quantities, and the batch caller’s actual input shape. Record whether failure is a returned error, a thrown exception, or a rejected promise. Include currency-specific precision only where the service supports it. Do not silently generalize a two-decimal contract to every currency.
Use fixtures without customer identifiers or production secrets. Freeze the unchanged implementation’s revision and preserve the capture procedure. Compare every contract field, not only the grand total: offsetting errors can leave the total unchanged while tax and discount records become wrong. Where generated cases supplement fixtures, compare old and extracted paths under a fixed seed and retain failing inputs.
Authorize one extraction, not a cleanup campaign
The authorized implementation moves the existing calculation into a module and updates the two identified callers. It keeps the same arithmetic dependency, rounding configuration, input contract, and output formatting. It does not upgrade packages, rename response fields, alter SQL, change event emission, or repair surprising calculation behavior. Those exclusions make the proposed benefit and the regression question inspectable.
- Acceptance All frozen calculation fixtures match field for field. Both known callers use the extracted module. Caller-level checks confirm that input adaptation, returned totals, and error propagation remain unchanged.
- Evidence Retain the baseline revision, capture procedure, test output, changed-file inventory, and an explicit list of integration checks that could not run. Inspect merge rules before claiming the checks are enforced.
- Stop condition Stop and request review if extraction requires a dependency change, reveals another caller, depends on hidden mutable state, or changes any fixture. Do not update expected outputs to make the task pass.
- Completion boundary The calculation boundary is extracted and verified for the agreed scope. The service is not declared fully modernized, and the dependency upgrade remains a separate decision.
Rollback is more than reverting the commit
For the hypothetical extraction, rollback should restore the prior deployable artifact without a database downgrade. That sounds straightforward because the task forbids schema changes. But a previous artifact does not undo invoices already issued with incorrect totals or retract events consumed downstream. Code recovery and business-record recovery are different plans.
Before deployment, name the person who can stop the rollout, the artifact to restore, the cohort exposed first, and the signals that trigger intervention. For this example, any confirmed field-level calculation mismatch should stop expansion. Use existing approved operational thresholds for errors and latency rather than inventing a universal percentage.
If parallel comparison is available, run both calculation paths on the same sanitized input without allowing the comparison path to write invoices or emit events. Keep comparisons away from mutable request objects. If incorrect records are created, preserve their identifiers and involve the finance owner in reconciliation. Replaying creation requests blindly could duplicate invoices even after the code has been restored.
Encode the procedure, not the approval
A skill is a useful place for the evidence checklist, comparison worksheet, stop conditions, and required artifacts. GitHub’s agent-skills guide distinguishes reusable instructions from the tools, credentials, and permissions supplied by the host. It also distinguishes advisory findings from checks that block merging through repository rules. Writing an approval requirement into instructions does not enforce it.
For this workflow, separate assessment from implementation. The assessment stage produces a ledger and candidate comparison without permission to deploy or modify production data. Implementation starts only with an approved scope. The architecture described in building a coding agent from scratch is relevant here: context, tool permissions, verification, and stop conditions determine what the agent can reliably deliver.
If the skill moves between clients, verify that each host loads its references, can execute the intended checks, and retains the same boundaries. Portable Agent Skills Need Portability Tests addresses that execution question. It comes after change selection: a portable procedure should not turn an unapproved upgrade into an approved one.
Use this worksheet before the next agent task
Avoid collapsing the decision into a single safety score. A high test count cannot cancel an irreversible data migration, and a tiny diff cannot cancel an unknown external contract. Use explicit gates instead. The following worksheet is an editorial synthesis, not a named GitHub standard.
- 01
Name the requirement and owner
State the business, support, security, or reliability reason for changing this component. Identify who can decide whether the capability still matters. If there is no requirement, keeping supported code may be the right answer.
- 02
List candidate treatments
Compare keeping, upgrading, swapping, wrapping, and rewriting where relevant. For each candidate, identify affected callers, contracts, stored data, and downstream effects. Explain why a less disruptive option is insufficient.
- 03
Attach evidence and blocking unknowns
For each claim, retain a location or execution record. Mark documented, inferred, and unverified items. Name which uncertainty blocks which candidate and what bounded investigation could resolve it.
- 04
Define what can be proved
Specify baseline behavior, comparison fields, caller checks, and missing integration coverage. Keep characterization expectations separate from desired corrections. If legacy execution is impossible, state that parity cannot yet be established.
- 05
Define recovery and stop conditions
Identify the previous artifact, rollout boundary, intervention owner, and consequences that rollback cannot undo. Reject or redesign candidates whose irreversible effects exceed the team’s authorization.
- 06
Approve a bounded outcome
Write permitted changes, exclusions, runnable acceptance criteria, required evidence, and the next human checkpoint. If evidence is insufficient, approve an investigation task instead of implementation.
There are limits. Repository evidence can miss undocumented consumers. Fixtures cover selected behavior, not every input. Two paths sharing the same defect can agree. An agent-generated explanation is not an execution result, and a second model’s agreement is not domain approval. The examined GitHub materials provide reported examples and a reusable procedure, not independent proof of a universal reduction in modernization risk.
For the next application, choose one observable workflow and ask for an evidence ledger before asking for code. The most useful first output may be a passing baseline, a resolved runtime contradiction, or a list of consumers confirmed by an owner. Modernization becomes more defensible when every step buys either a necessary capability or better evidence for the next decision, and stops before claiming more than it has proved.

