Skip to content

v0.31.0

Choose a tag to compare

@mariusei mariusei released this 28 Sep 22:07
· 64 commits to main since this release

sct diff now hands over the command that reads the change. The table said which structures changed and where; to see the lines, an agent had to build a focus address itself or fall back to git diff over whole files. In a field transcript that is what happened: sct diff for the overview, then git diff once the lines were needed. The answer now carries one line under the coverage line:

<6 files changed, 5 with structural rows, 1 without (1 no structural change)> 20fc283 → 7b607df
next: sct focus src/scantool/cli.py::build_parsers@7b607df (the largest changed body in full; @20fc283 for the old one)

It points at the changed structure whose body changed most, on the new side, and names the ref that reads the old side with the same address. Against the working tree the address carries no ref. The path is relative to where the command runs, with forward slashes on every OS, so it pastes as printed from a subdirectory too.

The address is checked before it is printed. A name taken straight from the diff rows broke on 4 of the 21 sample languages: a CSS :root split on the :: of the address, a C# or Java class resolved to its constructor as well, a nested SCSS selector matched nothing. The pointer now tries the qualified name, the bare name, each quoted, each with its line range, and keeps the first form that focus resolves to that one structure. The old-side hint appears only when the same address also finds the structure on the old side and the file kept its path. A test runs every language's pointer on both sides. focus's own history pointer uses the same check; its output is unchanged on all samples.

Not measured: whether agents follow the pointer instead of reaching for git diff. The change came from one transcript and has not been trialled.

Contract change, named. Every sct diff text answer with a changed (~) structure gains one next: line directly under the coverage line (a merge-base note stays above both). A diff with only added, removed or renamed structures gets none. JSON is unchanged. The diff goldens for all 21 languages with a second sample version gain that line and nothing else.