Repository navigation
fix(dashboard): show the GitHub PRs a chat owns on its card, not every PR it mentions - #35327
kyleseaman wants to merge 2 commits into
Conversation
UX Review (Opus 5.5) — ✅ PASS (a BLOCK with no Trigger and no Outcome does not block)UX-level review of UX-Verdict: PASS cannot evaluate: missing a screenshot of a session card with the new chip set. This PR changes which GitHub chips render on Crew sidebar cards, and their qualifier text, but supplies no image, so the blind read was not performed. Evidence gaps
Notes
[UX-REVIEWED] 948d472 Description read[DESCRIPTION-READ] 12953ca462f5edad59d67e9f9dc9ee9601b1ee04bf9cfb7ce94963ac9ae9f32c That sha256 names everything this verdict read: the PR description, plus the 3 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
Design Review (Opus 5.5) — ✅ PASSDesign-level review of Design-Verdict: PASS Nothing blocks: the ownership signals are additive, the chip payload and routes keep their shapes, and a revert brings back the old mention-scan chips. Notes
[DESIGN-REVIEWED] 948d472 Description read[DESCRIPTION-READ] 1046611c83b7634db38c4c97b787e6bd6f9a3aa3a417412775c7d85a1e88e1bc That sha256 names everything this verdict read: the PR description, plus the 1 evidence file(s) the workflow collected from it and handed this review. It covers that evidence because the media strip replaces every attachment URL with the same placeholder, so an edit swapping one attachment for another would leave the description's captured text identical while what this review judged changed. Recompute it with |
First Principles Review (Opus 5.5) — 🔴 BLOCKPremise-level review of First-Principles-Verdict: BLOCK
What this change shipsInventory (10 items) — 8 justifiedIntent: a card's GitHub chips show the PRs and issues the chat itself opened, acted on or reported, not every link it mentions. FIX.
BlockersA second wrapper-and-assignment stepper: duplicate [FIRST-PRINCIPLES-REVIEWED] 948d472 Description read[DESCRIPTION-READ] 998140887fba5e12c4792de21e4e1b8fe641db668c69a54bd52232ff8af50683 That sha256 names the PR description this verdict read. Recompute it with |
Opus 5.5 Review — ✅ no blocking findingsReviewed Verdict parsed from the review's SHA-scoped output markers for commit False positive or not applicable? A repository writer can comment: |
GPT 6.1 Review — ✅ no blocking findings (all downgraded on adjudication)GPT 6.1 flagged blocking issues on This comment is updated in place on each push. Review detailsBLOCKING -- src/kiro_crew/dashboard/source_providers/ownership.py:1031 -- Successful creates claim PRs printed by unrelated reads
Adjudication (Opus 5.5) — is blocking on each finding proportionate?F1 — LOW harm. I confirmed every condition the finding needs:
False positive or not applicable? A repository writer can comment: |
Code change approver recommendation: A person should decideWhy: the decider raised 1 possible problem and estimates a 60% chance that this change introduces a defect; a person should check it. The change replaces mention-based GitHub chips with ownership signals: gh write rows that exited 0, the work ledger, and roll-up from workers. The dashboard-turn path stores tool output and status and is well tested. But chats bound to a channel (Slack thread) persist tool rows without output or status, and their reply mentions no longer count, so their self-created PRs lose the chip they show on main. This regression on a sibling path isn't acknowledged as a non-goal and has no test. Smaller concerns (the copied gh api flag table, gh.exe) are non-blocking. Things to check (possible problems the decider raised; at this confidence many turn out to be fine):
An automated recommendation, not a review: a maintainer still decides. It approves on its own only when the estimated chance of a defect is at most 12% and the change has at most 400 changed lines. Decider v3c (217fe607) · commit |
19d100e to
3de23ff
Compare
6501205 to
bea97a0
Compare
bea97a0 to
f7c8ebb
Compare
f7c8ebb to
f0e520d
Compare
6681d5c to
bff19fc
Compare
59d1fa3 to
0753823
Compare
0753823 to
971bbc7
Compare
971bbc7 to
9578cfb
Compare
…y PR it mentions A session card's GitHub chips came from any pull-request or issue URL in any row's text: status notes, pasted context and compaction summaries all made chips, while the URL gh pr create printed (it sits in the tool row's output), the PR a worker reported, and the PRs a conductor's workers opened never did. A GitHub link now counts for a card when the chat created it (a successful gh pr create / gh issue create row), acted on it (a successful gh pr edit/comment/close/merge/ready/review or a writing gh api call on the pull), reported it (its work-ledger item's pr or an artifacts PR URL), or a worker bound to one of its items created or reported it (one level). Chips are ordered by the newest owning event, so a compaction summary can no longer reshuffle them. Other providers keep their mention rule, and the chat view's own Changes and Resources panels are unchanged. The sidebar's owner/repo qualifier now folds GitHub case like the backend identity already does.
…e shared shell reader, satisfy the repo guards
9578cfb to
948d472
Compare
|
Closing without merging. The remaining work is tracked in #38578, the main issue, which links the branches, including an unpushed newer head on backup/fix-github-link-detection-be48090586. Follow-ups: #38579 (known shell-reading gaps), #38580 (pin a PR to a chat card), #38581 (status for chips in the expanded list). The branch is kept. |
Problem / Motivation
Goal: A session card in the Crew sidebar shows the GitHub pull requests and issues the chat actually opened, worked on or reported, including those its workers opened, instead of every GitHub link its messages happen to mention.
A card's GitHub chips came from any PR or issue URL in the text of any row. Two things went wrong:
gh pr createprints the new URL into the tool row's output, which the sidebar never read. A worker'swork_report pr=Nwas never read either, and nothing carried a worker's PR up to the conductor that dispatched it. A conductor like "Reusable Issue Tracker Components" showed no chips while its two workers had opened feat(app-sdk): issue list components (useIssues, IssueList, IssueCard) #34732 and feat(source): POST /api/source/issues lists and searches GitHub and GitLab issues #34742, and 9 of the 63 PRs that open chats created never showed on their own card.Why it matters
The chips are how the owner finds the PR a chat is working on from the sidebar. When the right PR is missing and the card is full of PRs the chat only talked about, they have to open the chat and search the transcript, and the three visible chips are often the wrong three.
Not a goal
ghwrite or report.gh pr merge 5/gh pr review 5run with no-Rand no URL: gh prints nothing off a terminal, so the row does not say which repository it was.GH_HOST: with GitHub Enterprise hosts configured, a host-lessowner/repocounts only with aGH_HOST=on the call itself./clear:/clearstarts the conversation over, so the chips its rows named go, but the board keeps its items, so the card keeps the PRs they report.source_providers/links.py.gh pr list --jq '.[].url') reads as created.$nloop target credits only the first PR.gh ... || exit 1andgh ...; echo "exit=$?"count as masked, so a non-TTY write that prints nothing makes no chip.( ... )in the command makes every gh call in it unproven.$(...)(for example a multi-line<(cat <<'EOF' ... EOF)) stays in the blanked text and splits the command, so a gh call on that line counts as unproven.Exit Code:trailer, makes no chip: it stored no completed status, so nothing shows it ran.gh pr edit --add-label x && gh pr view) makes no chip.What changed (motivation → approach → change)
The sidebar scanned row text for URLs; the signals that say who owns a PR live in tool output and in the work ledger. A GitHub link now counts for a card only when one of these holds:
gh pr create/gh issue createrow that exited 0gh pr edit/comment/close/merge/ready/reviewor a writinggh api .../pulls/<N>that exited 0-Rplus number, or gh's ownpull request owner/repo#Npr(with the acceptance repo) and PR URLs in its artifactsReads (
gh pr view,checks, GETgh api) and--helpnever count; what writes is decided by the batch guard's own classifier (acp/batch_guard._gh_is_write), and agh apiendpoint is found by skipping the guard's own valued-option table (_GH_VALUED_OPTIONS), both read throughagent_sdk, so the card and the guard agree. A row counts only on proof that its call ran and succeeded: a shellExit Code: 0trailer, or the call's stored ACP statuscompleted. A refused, user-denied, failed, cancelled or still-running row never counts, whatever its argv names. A write whose exit the row's code does not vouch for (|| true, a pipe after it) counts only when gh's output names the PR. The gh proxy prints gh's own output and exit code, so its rows count the same way. Chips are ordered by the newest owning event, so a compaction summary cannot reorder them. A host-lessowner/reporeads as github.com only once the host settings have loaded and no Enterprise host is configured.source_providers/ownership.py(new),agent_sdk/__init__.pyagent_sdkhands it the batch guard's gh classifier and tables (gh_call_writes,gh_write_verbs,gh_valued_options,command_positionals), so it keeps no copy and nokiro_crew.acpimport.slot_projection.py,state_parts/source_links.py,slot_directory.py,chat_slot.py_pr_source_linksmerges own, ledger and worker links by identity, newest first, with unlinks applied to all; a conductor looks up its workers' live slots.work_ledger_store.py,source_providers/hosts.py,chat_turn/tool_results.py,restore_drivers.py,chat_persistence.pymeta.tool_status), a gh-write row's output or status invalidates the chip cache, and a restored sidebar tail keeps a gh-write row's command, output end (redacted, bounded) and status.website/src/utils/sourceProviderMeta.tssourceTabQualifiertreatsKiroCrewandkirocrewas one GitHub project, matching the backend identity (#34650).The chat view's Changes and Resources panels build their own list in the browser and are unchanged.
Backwards compatibility
Compatible: the slot payload, the expand route and the unlink route keep their shapes and keys. Stored unlink tombstones still match.
Reader: src/kiro_crew/dashboard/state_parts/source_links.py:_pr_source_links -- chat -- a GitHub link only mentioned in text leaves the card;
test_a_row_that_only_mentions_a_pr_makes_no_chipReader: src/kiro_crew/dashboard/chat_api/source_links.py:api_chat_slot_source_links -- crew page -- the "+N" expand serves the same owned list;
test_dashboard_source_links_expand.pyReader: src/kiro_crew/dashboard/chat_api/source_links.py:_apply_source_link_unlink -- crew page -- derived identities include rolled-up links, and the in-lock re-check reads tool output;
test_an_unlinked_rolled_up_chip_stays_hidden,test_an_owned_url_only_in_meta_still_authorizes_its_unlinkReader: src/kiro_crew/dashboard/state_parts/source_links.py:_slot_chip_urls -- crew page -- status refresh follows the owned chips;
test_dashboard_state_ws_status_refresh.pyReader: website/src/pages/chat/useChatPageResourcesController.tsx -- chat -- the Changes/Resources panels extract links in the browser and do not read this list; unchanged
Tests
test/test_source_link_ownership.py, one test per symptom, each failing onorigin/main:gh pr createrow with the URL only in its output gives 1 chip (chat-539's feat(app-sdk): issue list components (useIssues, IssueList, IssueCard) #34732 row).pr=34732shows it on the conductor card and on the worker's own (chat-537 / chat-539).kirodotdev/kirocrewand a createdkirodotdev/KiroCrewURL give 1 chip;website/src/test/sourceTabQualifier.githubCase.test.tscovers the qualifier (its two-spellings case fails onorigin/main).Nearby inputs tested: failed and refused creates (exit 1, "already exists" behind
|| true), reads and--help(not counted),gh issue create, another repository, a fork PR, every write verb and thereview/mergeswitches, bare numbers resolved from gh's output, a URL in--body, writinggh api(relative, absolute Enterprise,{owner}placeholders), masked writes, heredocs, here-strings, line continuations and2>&1, direct argv, artifacts URLs andowner/repo#N, a reported number with no repo, a worker that created without reporting or edited after creating, one-level roll-up, newest-event order across sources, unlinked rolled-up chips, a channel-born conductor, a bind after a card read, cold and Enterprise host settings, a restored sidebar tail,/clear(own chips go, board chips stay), the gh proxy output shape, non-ASCII and huge PR numbers, a bounded board answer, cache eviction, the ledger read happening off the loop, a 100-call command over 1 MB of output reading its output tail once, and compound commands: another gh call's or another program's printed URL (bare numbers,-Rmixes,{owner}/{repo}api paths, masked writes), pipelines gh starts,if/for/{ }blocks,!, quoted and unquoted$(...)and backticks (also in heredoc prose), and operators that end a line. TheTestAdversarialInputsandTestReviewFindings*classes pin what a fresh-context break attempt and the local GPT/Opus review prompts found. Each was shown red with the production change reverted.test/test_session_card_source_links_knob.pygains an autouse fixture restoring the chip switch: its config-PUT test left "off" in the process-wide snapshot, so later tests in the same xdist worker serialized no chips (4 failures when it runs beforetest_source_link_github_case.py, none with the fixture).The existing chip suites built their chips from assistant text; they now build them from a
gh pr createrow (test/source_link_rows.py). Tests of the text scanner's own mechanics moved to gitlab.com merge-request URLs, which still chip from a mention.Determinism:
test_source_link_ownership.pypasses 10 runs at-n0and 3 shuffled orders; the 74 files the change touches or that import a changed module pass at-n 2.Proof: not provable -- other: prove.py reports BASELINE_RED in its throwaway worktree on this host; every production hunk was reverted by hand instead and its tests shown red
Manual verification
On copies of real transcripts (no live chat touched): chat-539 now derives #34732 and chat-538 #34742, which neither card showed before. A warm re-derivation of the 4,618-row Slack Code conductor takes 11 ms, against 14 ms on
origin/main.Related Issues
N/A — no tracking issue.
Sibling sweep
Swept: git grep -nE "iter_source_url_candidates|_pr_source_links|source_links(" -- src/kiro_crew/dashboard website/src
Sibling: src/kiro_crew/dashboard/state_parts/source_links.py -- changed here
Sibling: website/src/utils/pullRequestLinks.ts -- not affected -- the chat view's own panel extractor, which the goal leaves as it is
Sibling: website/src/utils/extractChatLinks.ts -- not affected -- chat nav links from user/assistant rows, not card chips
Pattern harvest
Not generalizable: the rule is specific to which GitHub signals mean a chat owns a PR, and it now lives in the one derivation every chip consumer reads.
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)