fix(sessions): link a pull request to a session only on its own evidence - #14650
Conversation
|
bot: Fixed failing checks in fbf32ed. |
Code Review SummaryStatus: No Issues Found | Recommendation: Merge The prior findings are addressed in Files Reviewed (6 files)
Previous Review Summary (commit fbf32ed)Current summary above is authoritative. Previous snapshots are kept for context only. Previous review (commit fbf32ed)Status: 4 Issues Found | Recommendation: Address before merge The per-session PR link model correctly removes the worktree fan-out, the mention scrapers, and branch-name discovery. Findings are about evidence hardening and edge behavior, not the core design. Fix these issues in Kilo Cloud Overview
Issue Details (click to expand)WARNING
SUGGESTION
Files Reviewed (14 files)
Reviewed by deepseek-v4.1-flash · Input: 0 · Output: 0 · Cached: 0 Review guidance: REVIEW.md from base branch |
Reject dry-run/delete invocations and empty-source refspecs so a non-push never advances the session's stored headSha. Leave headSha untouched during refresh so a force-push by someone else cannot overwrite the session's pushed evidence, and log a host PR mismatch instead of silently keeping or replacing the link. Settle a migration candidate that already owns a real link so the legacy prune marker can complete.
|
bot: Fixed failing checks in 3eb55b0. |
Fix proof
[C1] a mentioned, listed or viewed PR is never a link and the mention scrapers are gone
Asserted value:
mention-proof: linked=false. Sense check (model): Head log line 'mention-proof: linked=false' names the asserted value and the test 'a mentioned, listed or viewed PR never links' passes (1 pass, 0 fail), with no base run provided so the head is judged alone.The scripts were proven on an earlier base, so only the head ran.
Head log: backend-assert 8afa453076e8 exited 0
[C2] a same-named branch in another repo or a fork never links
Asserted value:
crossrepo-proof: other=false fork=false. Sense check (model): Head assertion exits 0 and its log line 'crossrepo-proof: other=false fork=false' names the asserted value, with '(pass) ... a same-named branch in another repo or a fork never links'.The scripts were proven on an earlier base, so only the head ran.
Head log: backend-assert a43fcfefc69a exited 0
[C3] a reused branch name does not inherit the legacy per-worktree record
Asserted value:
reused-branch-proof: inherited=false pruned=true removed=true. Sense check (model): head log line "reused-branch-proof: inherited=false pruned=true removed=true" matches the asserted value with a (pass) and 1 pass / 0 fail; no base run is given, so the head alone is judgedThe scripts were proven on an earlier base, so only the head ran.
Head log: backend-assert 45218d1e3cf6 exited 0
[C4] the poll never discovers a link from a branch name alone
Asserted value:
poll-proof: calls=0 discovered=0. Sense check (model): head log line 'poll-proof: calls=0 discovered=0' names the asserted value and test '...never links' passed with exit 0The scripts were proven on an earlier base, so only the head ran.
Head log: backend-assert 1fe8ff9d483c exited 0
[C5] an explicit kilo pr link is scoped to one session and refuses another repo
Asserted value:
cli-pr-proof: no-session-error=true. Sense check (model): Head log names the asserted value 'cli-pr-proof: no-session-error=true' and its head assertions exit 0 with '(pass) ... an explicit link for another repository is refused'.The scripts were proven on an earlier base, so only the head ran.
Head log: backend-assert 481ab257ad51 exited 0
[C6] the heartbeat and ingest carry a per-session link with headRef/headSha, no fan-out, and all-null clears
Asserted value:
heartbeat-proof: owner-linked=true bystander-linked=false owner-headRef=feature/x owner-headSha=true. Sense check (model): Head assertion exited 0 and its log line 'heartbeat-proof: owner-linked=true bystander-linked=false owner-headRef=feature/x owner-headSha=true' exactly names the asserted value; no base run given, so the head is judged alone.The scripts were proven on an earlier base, so only the head ran.
Head log: backend-assert 3da0abfc31d2 exited 0
Fix proof
[C1] a mentioned, listed or viewed PR is never a link and the mention scrapers are gone
Asserted value:
mention-proof: linked=false. Sense check (model): head log line 'mention-proof: linked=false' names the asserted value with the test passing (1 pass, 0 fail)The scripts were proven on an earlier base, so only the head ran.
Head log: backend-assert 8afa453076e8 exited 0
[C2] a same-named branch in another repo or a fork never links
Asserted value:
crossrepo-proof: other=false fork=false. Sense check (model): head log line 'crossrepo-proof: other=false fork=false' names the asserted value with the test exit 0 and 1 pass, and with no base run the head is judged aloneThe scripts were proven on an earlier base, so only the head ran.
Head log: backend-assert a43fcfefc69a exited 0
[C3] a reused branch name does not inherit the legacy per-worktree record
Asserted value:
reused-branch-proof: inherited=false pruned=true removed=true. Sense check (model): head log line 'reused-branch-proof: inherited=false pruned=true removed=true' matches the asserted value and the head assertion exited 0 (no base run, judged on head alone)The scripts were proven on an earlier base, so only the head ran.
Head log: backend-assert 45218d1e3cf6 exited 0
[C4] the poll never discovers a link from a branch name alone
Asserted value:
poll-proof: calls=0 discovered=0. Sense check (model): Head log line 'poll-proof: calls=0 discovered=0' names the asserted value and the passing test asserts the poll never links a PR for a branch a session only checked out.The scripts were proven on an earlier base, so only the head ran.
Head log: backend-assert 1fe8ff9d483c exited 0
[C5] an explicit kilo pr link is scoped to one session and refuses another repo
Asserted value:
cli-pr-proof: no-session-error=true. Sense check (model): Head log line 'cli-pr-proof: no-session-error=true' matches the asserted value, with both scoping tests passing; no base run so judged on the head alone.The scripts were proven on an earlier base, so only the head ran.
Head log: backend-assert 481ab257ad51 exited 0
[C6] the heartbeat and ingest carry a per-session link with headRef/headSha, no fan-out, and all-null clears
Asserted value:
heartbeat-proof: owner-linked=true bystander-linked=false owner-headRef=feature/x owner-headSha=true. Sense check (model): Head assertion exited 0 and its log line 'heartbeat-proof: owner-linked=true bystander-linked=false owner-headRef=feature/x owner-headSha=true' exactly names the asserted value.The scripts were proven on an earlier base, so only the head ran.
Head log: backend-assert 3da0abfc31d2 exited 0
Fix proof
[C1] a mentioned, listed or viewed PR is never a link and the mention scrapers are gone
Asserted value:
mention-proof: linked=false. Sense check (model): head log line 'mention-proof: linked=false' matches the asserted value and the head assert exited 0 with 1 passThe scripts were proven on an earlier base, so only the head ran.
Head log: backend-assert 8afa453076e8 exited 0
[C2] a same-named branch in another repo or a fork never links
Asserted value:
crossrepo-proof: other=false fork=false. Sense check (model): head log line 'crossrepo-proof: other=false fork=false' matches the asserted value with the test passing (1 pass, 0 fail, exit 0)The scripts were proven on an earlier base, so only the head ran.
Head log: backend-assert a43fcfefc69a exited 0
[C3] a reused branch name does not inherit the legacy per-worktree record
Asserted value:
reused-branch-proof: inherited=false pruned=true removed=true. Sense check (model): Head assertion exited 0 and its log line 'reused-branch-proof: inherited=false pruned=true removed=true' names the asserted value, with the test passing.The scripts were proven on an earlier base, so only the head ran.
Head log: backend-assert 45218d1e3cf6 exited 0
[C4] the poll never discovers a link from a branch name alone
Asserted value:
poll-proof: calls=0 discovered=0. Sense check (model): head assertion exited 0 and its log line 'poll-proof: calls=0 discovered=0' matches the asserted value, judged alone as no base run is givenThe scripts were proven on an earlier base, so only the head ran.
Head log: backend-assert 1fe8ff9d483c exited 0
[C5] an explicit kilo pr link is scoped to one session and refuses another repo
Asserted value:
cli-pr-proof: no-session-error=true. Sense check (model): The head log line 'cli-pr-proof: no-session-error=true' names the asserted value, and its passing assertions 'an explicit link is recorded for the named session only' and 'an explicit link for another repository is refused' show the claimed scoping and refusal.The scripts were proven on an earlier base, so only the head ran.
Head log: backend-assert 481ab257ad51 exited 0
[C6] the heartbeat and ingest carry a per-session link with headRef/headSha, no fan-out, and all-null clears
Asserted value:
heartbeat-proof: owner-linked=true bystander-linked=false owner-headRef=feature/x owner-headSha=true. Sense check (model): head assertion exited 0 and its output line 'heartbeat-proof: owner-linked=true bystander-linked=false owner-headRef=feature/x owner-headSha=true' names the asserted value exactly; with no base run the head is judged alone.The scripts were proven on an earlier base, so only the head ran.
Head log: backend-assert 3da0abfc31d2 exited 0
Changelog for users
kilo pr linkapplies to one named session and refuses a pull request for another repository.kilo pr unlinkandkilo pr statusact on one session and report no link when it owns none.Changelog for maintainers
session_pr_linkand the heartbeat now carryheadRefandheadShabeside the three legacy keys so older backends keep working.kilo pr link|unlink|statusandset_pr_linkrequire a session id and fail closed without one; thelink_prtool refuses a fork or another repository.E2E proof
[C1] a mentioned, listed or viewed PR is never a link and the mention scrapers are gone
Asserted value:
mention-proof: linked=false. Sense check (jev): probability 0.94Base log: backend-assert 8afa453076e8 exited 1
Head log: backend-assert 8afa453076e8 exited 0
[C2] a same-named branch in another repo or a fork never links
Asserted value:
crossrepo-proof: other=false fork=false. Sense check (jev): probability 0.94Base log: backend-assert a43fcfefc69a exited 1
Head log: backend-assert a43fcfefc69a exited 0
[C3] a reused branch name does not inherit the legacy per-worktree record
Asserted value:
reused-branch-proof: inherited=false pruned=true removed=true. Sense check (jev): probability 0.93Base log: backend-assert 45218d1e3cf6 exited 1
Head log: backend-assert 45218d1e3cf6 exited 0
[C4] the poll never discovers a link from a branch name alone
Asserted value:
poll-proof: calls=0 discovered=0. Sense check (jev): probability 0.92Base log: backend-assert 1fe8ff9d483c exited 1
Head log: backend-assert 1fe8ff9d483c exited 0
[C5] an explicit kilo pr link is scoped to one session and refuses another repo
Asserted value:
cli-pr-proof: no-session-error=true. Sense check (jev): probability 0.92Base log: backend-assert 481ab257ad51 exited 1
Head log: backend-assert 481ab257ad51 exited 0
[C6] the heartbeat and ingest carry a per-session link with headRef/headSha, no fan-out, and all-null clears
Asserted value:
heartbeat-proof: owner-linked=true bystander-linked=false owner-headRef=feature/x owner-headSha=true. Sense check (jev): probability 0.95Base log: backend-assert 3da0abfc31d2 exited 1
Head log: backend-assert 3da0abfc31d2 exited 0
Owner request