Candidate fixes

Candidate fixes

On a source-grounded finding you can ask for a fix proposal: a candidate change written against the exact source line that was cited.

Asking for one

Click a citation to open the code, then Propose a fix. Generation starts only when you confirm in the dialog, never on hover or page load. A fix is offered on a citation that matches an exact line of source; a citation quoted inside a report body is a pointer without a finding around it, so its panel reads the code but offers no fix.

A citation without that exact match can show you the code but not change it: where none of your captures matches the cited line exactly, the panel says so and offers no fix. A later capture citing the same line exactly makes it answerable again. On the API, GET /api/v1/source/fix-proposal answers 422 at those sites.

While it works

Tracing a problem back through the code can take a few minutes. Where a fix is worked out step by step, the dialog shows each step as it happens: the files it reads, the callers and callees it follows, and any read that was declined or could not be answered. A fix worked out in one pass shows no steps, and neither does one already saved for that line.

If your connection drops while a fix is being worked out, the work carries on and is saved. Reopen the line in a few minutes to see it, rather than asking again, which would be charged again.

What comes back

The dialog is headed with the file, line and function it was written against, and contains:

  • Summary: a one-line headline of the change.
  • Why this fix: the reasoning, tied to the code that was read.
  • Candidate change: a unified diff anchored to the real lines of the cited file.
  • Verify: what to test before you trust it.
  • A confidence rating, and where one exists, a reference to an upstream fix that already addresses the problem.

Some proposals come back as guidance rather than a diff. The rationale says which case applies: the code is sensitive enough that a patch should not be pasted in unread, too little surrounding code could be read to be confident in a specific edit, or the code shows there is nothing to fix because the log line is expected behaviour. The last is a real answer, not a refusal.

A proposal often points at a different line than the one that logged. A log line is where a problem was reported; the code that has to change is frequently the caller that produced the bad state. When they differ, the proposal names the file and function to change and walks through how the cited line got there. If it ran out of room before confirming the cause, it says so, and says which limit it reached: the number of steps it could take, or the amount of code it could read. Treat that conclusion as provisional.

What it is not

We propose; we never apply. Nothing is committed, no branch is pushed, no pull request is opened. You review the candidate, adapt it to your tree, and apply it yourself.

It is a candidate, not a verified patch. It is written against the platform source version that was cited, which may differ from your tree, which is why every proposal ships with a Verify section. The confidence rating is self-assessed, not a measured accuracy. A proposal covers one location in one file.

Cost and reuse

Generating a proposal draws down your investigation units. Reading one that already exists does not. The charge is flat per proposal: it depends on whether the problem was traced back through the code, not on how far the tracing went or on the size of your capture.

A proposal is stored against the source location rather than your capture, so it is generated once and read many times. Anyone in your organization with a capture citing that same line reads the stored copy; without such a capture they don’t see it. The stored copy was written for whichever finding reached that line first, so its wording follows that finding rather than yours. Deleting the capture that led you to it does not remove the proposal; see Security and data handling.

A stored proposal is tied to the build of the platform source it was written against. When the build being served is no longer that one, the stored copy is not shown and the dialog offers to work a proposal out again. Reading is still free, and that fresh proposal is charged like any other. A proposal stored before this was recorded carries no build and keeps being read whatever is served.

If the cited code can’t be read when you ask, or the line turns out to be routine bookkeeping rather than a fault, the dialog says so and nothing is charged.

An attempt can also fail after it has started: the model stops before it produces a proposal, its answer can’t be used as one, or something on our side is briefly unavailable. The dialog says which, shows the steps it took before it stopped where it recorded any, and offers to ask again. That attempt is charged, because the work was done, and asking again is charged again. The reason is kept with the site, so reopening the dialog shows it until a later attempt replaces it.

Privacy

Generating a proposal sends the cited source and a description of the finding to the model that writes the candidate. Your raw capture is not sent. Ask us if your organization needs the specifics in writing.

Next