Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## 0.23.1

Two fixes: a data file could select zero tests, and a PR's Intent could open with another session's work.

- A changed data file whose walk reaches no test now runs the full suite instead of selecting zero tests. "Data" means a file that isn't in one of the languages CGraph parses as code (C, C++, C#, Apex, Go, Rust, Groovy, Java, JavaScript, Kotlin, Delphi, Python, Ruby, Scala, TypeScript), such as SQL, Cypher, GraphQL, Protobuf, OpenAPI and XML. The graph records no reads of data by code, so a walk that finds no test is not evidence that no test reads the file. That holds whether nothing points at the file's nodes, only another migration's foreign key does, or only untested code does. On a TypeScript service, a one-line edit to each of five migrations selected 0 tests before and runs the full suite now; migrations were masked while their journal file had no graph node, and exposed once the journal folder was ignored. A data file whose walk reaches tests (a table a model uses) keeps its subset, and a code file nothing depends on still selects zero tests. The comment says the file "reaches no test in the graph" (`unreached` on the reason), not that it has no node.
- The Intent cell's narration and the "Ran before push" commands come only from the sessions that worked on the commit's files, as the prompt already did. Entire attaches every session live in the checkout when a commit is made. On one web-app PR, ten sessions were attached. The Intent opened with a call-summary session's first line, and 30 test commands came from other tasks. Now it shows the working session's own words and its 2 commands. With no session working on the files, every session still counts.

## 0.23.0

"What the agent decided" finds test outcomes, edits and subagents the way agents actually work. Replayed on 96 checkpointed commits of a web-app repository since 2026-09-20, the section had a line for 1 of them before (a design note) and for 20 after: 13 with runs that failed and then passed, 6 commits made right after a failing run with no pass, and 4 with design notes weighing alternatives (one commit can have several).
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Fail-open triggers, each a typed reason in the output:

| Reason | Fires when |
| --- | --- |
| `unmapped-file` | a changed file has no graph node (configs, lockfiles, assets) — declare irrelevant paths with `--ignore`. A file on the loaded-by-convention list in `src/unnamed.ts` (Spring `application*.yml`, Gradle and other build or dependency manifests, test-runner and toolchain config, test setup files, `conftest.py`, `build.rs`) fires it even when the graph has nodes for it, and the comment says so: cgraph gives `application.yml` and `build.gradle.kts` nodes, and seeding them selected a handful of tests or none. When nothing outside Markdown names a file or any folder above it (case ignored), and it is not on the never-list in `src/unnamed.ts` (Spring config, `src/*/resources/`, snapshots, `testdata`/`fixtures` folders, dependency manifests and lockfiles for JS, Python, JVM, Go, Rust, Ruby, PHP, .NET, Swift and Dart, build files such as `Makefile`, and test-runner and toolchain config), the comment offers it as a pattern to add under `ignore: |`; the run still fails open. One exception: a **CMake hunk that does nothing but register new test targets** is read rather than refused, and the tests it declares are selected (see below) |
| `unmapped-file` | a changed file has no graph node (configs, lockfiles, assets) — declare irrelevant paths with `--ignore`. A data file (one not in a language CGraph parses as code: SQL, Cypher, GraphQL, …) whose walk reaches no test fails open too, marked `unreached`: the graph records no reads of data by code, so selecting nothing could drop its tests. A file on the loaded-by-convention list in `src/unnamed.ts` (Spring `application*.yml`, Gradle and other build or dependency manifests, test-runner and toolchain config, test setup files, `conftest.py`, `build.rs`) fires it even when the graph has nodes for it, and the comment says so: cgraph gives `application.yml` and `build.gradle.kts` nodes, and seeding them selected a handful of tests or none. When nothing outside Markdown names a file or any folder above it (case ignored), and it is not on the never-list in `src/unnamed.ts` (Spring config, `src/*/resources/`, snapshots, `testdata`/`fixtures` folders, dependency manifests and lockfiles for JS, Python, JVM, Go, Rust, Ruby, PHP, .NET, Swift and Dart, build files such as `Makefile`, and test-runner and toolchain config), the comment offers it as a pattern to add under `ignore: |`; the run still fails open. One exception: a **CMake hunk that does nothing but register new test targets** is read rather than refused, and the tests it declares are selected (see below) |
| `stale-graph` | the graph fails a content-root pin (`--expect-root`, or `--daemon-verify` against the live CGraph daemon), or `graph.json` is older than the head commit |
| `sparse-graph` | the graph averages under 3 edges per file — an under-extracted graph produces subsets that look smart and are blind, so blastline refuses |
| `disconnected-tests` | tests can forward-reach under 25% of the code's symbols — the graph passed the density floor but is blind for selection (how broken Go/Python extraction presented, and how every Rust graph presents today) |
Expand Down Expand Up @@ -203,7 +203,7 @@ What the reviewer sees, in order:
| --- | --- |
| **Verdict** — `N of M test files reach this diff`, `K agent commits` | the selection, unchanged |
| **Summary** — Changed, Tests reached, Downstream code (with a **review effort** tier: `high` from 20 dependents or 10 mapped files, `low` under 5 dependents and 4 files, `medium` between; fixed thresholds), plus **Intent** (how many commits carry a checkpoint, which models), **Reviewed by** (who has reviewed other than the author, or `no reviewer other than the author (login) so far`; and the humans whose commits last changed the changed and reached files before this range, agent-authored commits set aside), **Symbols** (changed / added / removed / moved), **Since push `<sha>`** (new commits, changed files, tests reached, newly reached files) | the checkpoint refs, `cgraph change-context`, the snapshot embedded in the previous comment |
| **What each commit did** — Commit · Intent · Files · Reaches · Ran before push, folded after 10 commits | each commit's `Entire-Checkpoint:` trailer, resolved to `refs/entire/checkpoints/<shard>/<id>` (a 26-character id) or to `<first two>/<rest>/` on the branch `entire/checkpoints/v1` (a 12-character id); the Intent cell is what the agent said in the turn that produced the commit, then the agent and model; without a checkpoint, the commit's own marks (an `Agent-Logs-Url:` trailer, a vendor address as author or `Co-authored-by:`) name the agent |
| **What each commit did** — Commit · Intent · Files · Reaches · Ran before push, folded after 10 commits | each commit's `Entire-Checkpoint:` trailer, resolved to `refs/entire/checkpoints/<shard>/<id>` (a 26-character id) or to `<first two>/<rest>/` on the branch `entire/checkpoints/v1` (a 12-character id); the Intent cell is what the agent said in the turn that produced the commit (only the sessions that worked on the commit's files count when Entire attached others live in the same checkout), then the agent and model; without a checkpoint, the commit's own marks (an `Agent-Logs-Url:` trailer, a vendor address as author or `Co-authored-by:`) name the agent |
| **What the agent decided** — at most 8 lines, each with its kind and commit, in session order; omitted when no checkpoint holds one | the turns in each checkpoint's part of the compact transcript, from the commit's own turn on, that hold a tool call working on one of the PR's files at this repo's root (an edit tool's absolute path, a command naming it, or a command run at the root that names it by its repo path, the shell's directory being followed through `cd`s across calls; the root is the one the edits to files inside folders and those commands agree on, else the one the last `git commit` ran in, and with none nothing is read; a subagent's tool calls, when Entire keeps its transcript, count inside the turn that started it), skipping what the agent does while away from the repo (from the transcript's start, and after an edit, read or search outside the root, a `cd`, `pushd` or `git -C` elsewhere, a `../` or `$VAR/` path, or an absolute path outside the root, until it works at the root or `cd`s back; this carries across turns, as the shell's directory does) (`src/decisions.ts`, no model): a test runner and the test files the change carries that failed and then passed or whose last run failed (by the runner's own summary line in the call's output, read and never shown, else the call's status for a bare run; one run per command, none against swapped-in code; files named only when the run targets nothing else), reverts (by a fixed label such as `git revert`), and design notes the change adds that weigh alternatives (by repo path). No free text is quoted, neither what a person typed nor what the agent wrote. More than 8: test outcomes and reverts are kept first |
| **Claims checked** — `refuted`, `partial` or `consistent`, refuted first | `blastline check` on removed symbols against the base graph; a changed declaration against its base-graph callers outside the diff; the reaching tests against the test commands the checkpoint ran; files touched against the commit; the PR body and each commit message against the diff |
| **What each changed file reaches** — a **Why** column (present when a checkpoint carries one) gives, per file, the agent's own line before the edit that touched each changed symbol, with its turn; a **Read** column gives the order (widest reach first; a changed file another changed file reaches sits right after it as `with <file>`; test files last), the Change column names what happened to each symbol | the reach walk; `cgraph change-context`, `changes[].symbol_changes` |
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "blastline",
"version": "0.23.0",
"version": "0.23.1",
"description": "Graph-backed test impact and blast radius for CI and PRs, built on CGraph",
"license": "MIT",
"type": "module",
Expand Down
17 changes: 17 additions & 0 deletions src/checkpoint.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -423,6 +423,23 @@
expect(cp?.prompt).toBe("put the minimum back");
});

it("says what the working session did and ran, not a session on another task that Entire attached", () => {
// Entire attaches every session live in the checkout: session 0 summarises a call, the other session does the commit.
const HEX_W = "6a1b2c3d4e5f";
const aside = [rec("user", stamp(1), [user("summarise the planning call")]), rec("assistant", stamp(2), [text("I'll read the call transcript and pull the comments.")]), rec("assistant", stamp(3), [bash("bunx vitest run src/unrelated.test.ts")])];
const work = [
rec("user", stamp(20), [user("let the cap go to sixteen")]),
rec("assistant", stamp(21), [text("I've read the ticket; raising the cap.")]),
rec("assistant", stamp(22), [edit("src/round-size.ts", "export const ROUND_SIZE_MAX = 16;"), bash("bunx vitest run src/round-size.test.ts")]),
];
writeBranchCheckpoint(HEX_W, branchFiles(HEX_W, stamp(23), aside, "", { session: OTHER, transcript: work }));
const w = commitFile("src/round-size.ts", "export const ROUND_SIZE_MAX = 16;\n", `fix: the cap goes to sixteen\n\nEntire-Checkpoint: ${HEX_W}\n`);
const cp = checkpointFor(repo, w, [], new Map(), ["src/round-size.ts"]);
expect(cp?.prompt).toBe("let the cap go to sixteen");
expect(cp?.narration.started).toBe("I've read the ticket; raising the cap.");
expect(cp?.testCommands).toEqual(["bunx vitest run src/round-size.test.ts"]);
});

Check notice on line 442 in src/checkpoint.test.ts

View workflow job for this annotation

GitHub Actions / blastline

blastline: reach

Reaches 0 files and 1 test file.
it("finds a symbol's reason in the since-window even when the narration window starts later", () => {
const cp = checkpointFor(repo, commitA, [{ path: "src/round-size.ts", label: "ROUND_SIZE_MAX" }], new Map(), ["src/round-size.ts"]);
expect(cp?.reasons).toEqual([{ path: "src/round-size.ts", label: "ROUND_SIZE_MAX", turn: 4, why: "I'll start by reading the ticket, then set up a worktree off dev." }]);
Expand Down
22 changes: 16 additions & 6 deletions src/checkpoint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -909,6 +909,9 @@
const decisions: Decision[] = [];
const testCommands = new Set<string>();
let narration: Narration = { started: "", ended: "", texts: 0, tools: 0 };
// Each session's own part, combined after the loop; `activity` counts texts and tool calls across every session.
const parts: { worked: boolean; narration: Narration; testCommands: string[] }[] = [];
let activity = 0;

Check notice on line 914 in src/checkpoint.ts

View workflow job for this annotation

GitHub Actions / blastline

blastline: reach

Reaches 7 files and 7 test files through checkpointFor.
const sessions: CheckpointSession[] = [];
let readBefore = 0;
const reasons = new Map<string, SymbolReason>();
Expand Down Expand Up @@ -946,21 +949,28 @@
}
if (extended) readBefore++;
sessions.push({ id: sessionId, lines, hash });
for (const c of testCommandsIn(turnWindow)) testCommands.add(c);
for (const r of symbolReasonsIn(sinceWindow, symbols, contents)) reasons.set(`${r.path}\0${r.label}`, r);
const n = narrationIn(stepWindow);
activity += n.texts + n.tools;
parts.push({ worked, narration: n, testCommands: testCommandsIn(turnWindow) });
}
// Entire attaches every session live in the repo when the commit is made. When some worked on the commit's
// files, only theirs say what the commit's session did and ran; the rest (other tasks in the same checkout) are left out.
const own = parts.some((p) => p.worked) ? parts.filter((p) => p.worked) : parts;
for (const p of own) {
for (const c of p.testCommands) testCommands.add(c);

Check notice on line 961 in src/checkpoint.ts

View workflow job for this annotation

GitHub Actions / blastline

blastline: reach

Reaches 7 files and 7 test files through checkpointFor.
narration = {
started: narration.started || n.started,
ended: n.texts > 0 ? n.ended || n.started : narration.ended,
texts: narration.texts + n.texts,
tools: narration.tools + n.tools,
started: narration.started || p.narration.started,
ended: p.narration.texts > 0 ? p.narration.ended || p.narration.started : narration.ended,
texts: narration.texts + p.narration.texts,
tools: narration.tools + p.narration.tools,

Check notice on line 966 in src/checkpoint.ts

View workflow job for this annotation

GitHub Actions / blastline

blastline: reach

Reaches 7 files and 7 test files through checkpointFor.
};
}
if (narration.ended === narration.started) narration.ended = "";
let prompt = ask;
for (let i = 0; prompt === "" && i < sessionCount; i++) prompt = typed(i);
// The same step: every session's transcript extends what an earlier commit read, and nothing came after.
const sameStep = readBefore > 0 && readBefore === sessions.length && narration.texts === 0 && narration.tools === 0 ? read.get(sessions[0]!.id)?.sha : undefined;
const sameStep = readBefore > 0 && readBefore === sessions.length && activity === 0 ? read.get(sessions[0]!.id)?.sha : undefined;

Check notice on line 973 in src/checkpoint.ts

View workflow job for this annotation

GitHub Actions / blastline

blastline: reach

Reaches 7 files and 7 test files through checkpointFor.
return {
id,
commit: git(repo, ["rev-parse", `${commit}^{commit}`]).trim(),
Expand Down
16 changes: 16 additions & 0 deletions src/comment.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,22 @@
expect(md).toContain("All 2 unmapped files");
});

it("says a data file reaches no test instead of claiming it has no graph node", () => {
const md = renderComment(
{
kind: "all",
reasons: [
{ kind: "unmapped-file", path: "db/migrations/0002_audit.sql", unreached: true },
{ kind: "unmapped-file", path: "assets/logo.svg" },
],
},
ctx,
);
expect(md).toContain("**1 file has no graph node**");
expect(md).toContain("**1 data file reaches no test in the graph**");
expect(md).toContain("so code may still read it, and selecting no tests would drop its tests");
});

Check notice on line 306 in src/comment.test.ts

View workflow job for this annotation

GitHub Actions / blastline

blastline: reach

Reaches 0 files and 1 test file.
it("offers the unmapped files nothing names as ignore patterns, and only those", () => {
const md = renderComment(
{
Expand Down
6 changes: 5 additions & 1 deletion src/comment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -461,12 +461,16 @@
const listed = paths.slice(0, 50).join("\n");
const more = paths.length > 50 ? `\n… ${paths.length - 50} more` : "";
const loaded = reasons.filter((r) => r.convention).length;
const nodeless = paths.length - loaded;
const unreached = reasons.filter((r) => r.unreached).length;
const nodeless = paths.length - loaded - unreached;

Check notice on line 465 in src/comment.ts

View workflow job for this annotation

GitHub Actions / blastline

blastline: reach

Reaches 3 files and 2 test files through renderUnmapped.
return [
...(nodeless > 0 ? [`**${nodeless} file${nodeless === 1 ? " has" : "s have"} no graph node** (config, asset, or unextracted).`, ""] : []),
...(loaded > 0
? [`**${loaded} file${loaded === 1 ? " is" : "s are"} loaded by convention** (framework config, a build or dependency manifest, toolchain config): the graph has nodes for ${loaded === 1 ? "it" : "them"}, but every test may depend on ${loaded === 1 ? "it" : "them"}.`, ""]
: []),
...(unreached > 0
? [`**${unreached} data file${unreached === 1 ? " reaches" : "s reach"} no test in the graph** (SQL, Cypher, GraphQL and the like): the graph records no reads of data by code, so code may still read ${unreached === 1 ? "it" : "them"}, and selecting no tests would drop ${unreached === 1 ? "its" : "their"} tests.`, ""]
: []),

Check notice on line 473 in src/comment.ts

View workflow job for this annotation

GitHub Actions / blastline

blastline: reach

Reaches 3 files and 2 test files through renderUnmapped.
"If these files cannot change which tests should run, add a pattern for them to `ignore`. If they feed tests (fixtures, data), this outcome is correct.",
"",
...suggestIgnores(reasons.filter((r) => r.unnamed).map((r) => r.path)),
Expand Down
13 changes: 13 additions & 0 deletions src/detect.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,19 @@
);
}

/**
* Code whose uses CGraph extracts: the languages its `detect.cpp` parses with a
* grammar (C, C++, C#, Apex, Go, Rust, Groovy, Java, JavaScript, Kotlin, Delphi,
* Python, Ruby, Scala, TypeScript). Every other file the graph holds (SQL, Cypher,
* Protobuf, GraphQL, OpenAPI, XML, configs) is data: CGraph records no read of it,
* so nothing pointing at its nodes is not evidence that nothing reads it.
*/
const CODE = /\.(?:c|h|cc|cpp|cxx|hpp|hh|hxx|cs|cls|trigger|go|rs|groovy|gvy|gradle|java|js|jsx|mjs|cjs|kt|kts|pas|pp|dpr|py|pyw|rb|scala|sc|ts|tsx)$/i;

export function isCodePath(path: string): boolean {
return CODE.test(path);
}

Check notice on line 43 in src/detect.ts

View workflow job for this annotation

GitHub Actions / blastline

blastline: reach

Reaches 7 files and 9 test files through isCodePath.
/**
* JVM test conventions for Java and Kotlin, taken from the build tools' own
* default class-name patterns — the JVM analog of Go's compiler-enforced
Expand Down
Loading
Loading