Repository navigation
feat(session-control): session_history_list lists archived sessions a caller can revive - #15441
Pearcekieser wants to merge 2 commits into
Conversation
|
👋 Hi! This PR is currently in draft status. Workflow runs won't be auto-approved until it's marked as ready for review. When you're ready, click "Ready for review" and the workflows will be approved on the next cycle automatically. |
1 similar comment
|
👋 Hi! This PR is currently in draft status. Workflow runs won't be auto-approved until it's marked as ready for review. When you're ready, click "Ready for review" and the workflows will be approved on the next cycle automatically. |
a418a87 to
9d49ff8
Compare
|
Full implementation is pushed on top of the skeleton, rebased on main bf53de7. A pre-push local review found two issues, both fixed in 9d49ff8:
Two new tests cover these. Both fail on 81c7982 and pass on 9d49ff8. |
First Principles Review (Opus 5.5, fork) — 🟡 CONCERNSPremise-level review of First-Principles-Verdict: CONCERNS
Not justified as shipped
What this change shipsInventory (6 items) — 4 justifiedIntent: an agent can find which archived session to pass to
[FIRST-PRINCIPLES-REVIEWED] b649c4d Description read[DESCRIPTION-READ] c1e47d4e379fc7cd2e105f1bee83915f70ecdfa762e7dc249be1478607b1907a That sha256 names the PR description this verdict read. Recompute it with |
Design Review (Opus 5.5, fork) — 🟡 CONCERNSDesign-level review of Design-Verdict: CONCERNS The listing's promise that every row passes Watch
[DESIGN-REVIEWED] b649c4d Description read[DESCRIPTION-READ] a081609568eb7ac0f3059f87ad05a05a1ba51db6d65591af4f590c64c369350f 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 |
9d49ff8 to
74a69a4
Compare
|
Rebased onto main acd219f. #15166 added |
GPT 6.1 Review (fork) — 🔴 changes requested (blocking)Reviewed 1 of 1 blocking finding(s) are security-class and were withheld from adjudication, so the blocking verdict stands. BLOCKING -- src/kiro_crew/dashboard/session_control.py:6237 -- Final worker hop leaves mirror authorization stale Adjudication (Opus 5.5) — is blocking on each finding proportionate?F1 is fenced, so my verdict can't unblock the merge. I'm marking it FLAG, which leaves it blocking but gives a human reviewer a drafted reason to override it. F1 — unbounded-harm class (security). I confirmed the conditions in the code:
🏷️ Fenced finding(s) machine-flagged as likely edge caseThe security fence keeps these findings blocking regardless of adjudication; the only clearance path is a human override recorded by a repository writer, who must independently verify a rationale before recording it — it is machine-authored, and a wrong override on a security-class finding ships exactly the class the fence exists to stop. (This lane's comment deliberately carries no override command.)
|
Opus 5.5 Review (fork) — ✅ no blocking findingsReviewed |
|
issue (blocking): fixed in 60bf402. This is the unbounded A history row now keeps |
60bf402 to
595f6c3
Compare
|
Squashed to one commit and rebased onto main 3ecea02, now at 595f6c3. PR Hygiene failed on 60bf402 because the branch had 4 commits. The tree is unchanged apart from main's new commits. The Windows installer failure on 60bf402 was an HTTP 500 during the electron-builder download, not a code failure. |
|
Round on issue (blocking, GPT 5.6): the capped list drops the overflow count. Upheld and fixed. thought (non-blocking, Design review): the scan restates revive's refusal clauses. Agreed that this is a real drift risk. This round doesn't change it. Factoring revive's per-row metadata refusals into one predicate that both verbs call would touch |
1f9b94f to
304f8f6
Compare
|
Rebased onto current main, now at 304f8f6. The diff is unchanged. This re-runs CI after Backend Tests (3.12, 3) failed on |
|
Holding todo: a maintainer "Re-run failed jobs" on CI run 36855809603 should turn this head green without re-running the review lanes. |
74b80c5 to
64f235a
Compare
64f235a to
a69bc93
Compare
|
Round on issue (blocking, GPT 5.6): the scan cap followed an unbounded catalog read. Agreed. I had left this out on Because the scan no longer gets catalog rows, it drops the catalog pre-filters on Two new tests. One makes |
… caller can revive
The capped listing now keeps walking the catalog past limit, keeping only the key of each further eligible row, and returns that count as omitted (after dropping any revived during the scan). The MCP tool renders it as 'N more not shown'. Addresses the GPT 5.6 finding on 595f6c3.
a69bc93 to
b649c4d
Compare
|
Triage: closing as a duplicate of #16530, which carries this change forward. Credit stays with @Pearcekieser. Evidence (origin/main
The open review notes still apply to #16530: the post-scan mirror/fence re-check race, and revive's refusals being duplicated in |
Problem / Motivation
Goal: an agent can list the archived sessions it is allowed to revive, so it can find the right
session_revivetarget without guessing a title.session_revive(#13110) needs a slot key, transcript name, or exact title, and nothing on thekirocrew-dashboardMCP server lists archived sessions.chat_folder_treeshows live sessions only. An agent asked to "reopen last week's investigation in folder X" cannot see what is there.Why it matters
Three live tool descriptions (
chat_folder_move_session,chat_tag_assign,chat_session_pin) tell agents to bring an archived session back withsession_revivefirst. Without a listing, that advice only works when the agent already knows the key.Not a goal
search_chat_historydoes that).chat_folder_treeoutput.What changed (motivation → approach → change)
The listing is the finding half of a revive, so it applies revive's own rules and lists only rows revive would accept for this caller.
session_control.list_archived_sessionsruns revive's caller-side gate first (identity, live surface, ownership fence), then scans the history catalog newest first on a worker thread (_scan_revivable_history). It skips live slots, scheduled-run and member DM keys, non-persistent memory modes, app-scoped, channel-linked and mirrored sessions, and other workspaces. For a fenced caller it keeps only sessions whosecreated_byis the caller and whose crew-log lineage confirms it. When the lineage cannot answer, the rows are hidden andlineage_unknownis set. After the scan it re-checks the caller surface and drops rows that went live meanwhile._fold_slot_key) so both paths fold keys the same way.GET /api/session-control/history(folder_id,limit) is added to the strict internal-secret route set inserver.py.session_history_list(folder?, limit?): the folder is resolved read-only, and an unknown folder is refused rather than created or answered with an empty list.limitis 1 to 100, default 20, clamped by the backend too. The reply says when more rows exist.docs/session-control.md(+ index count), the system spec, the MCP architecture doc and the feature map are updated.Backwards compatibility
Compatible: one read-only tool and one GET route are added. Revive behaves the same; only its fold helper moved.
Tests
test/test_session_control_history_list.py(23 tests): ordering and live-slot skip, every listed row accepted byrevive_session, limit and clamp, folder filter and unknown folder, each revive refusal class hidden, fenced caller with confirmed, foreign and unreadable lineage, caller refused before history is read, a row revived mid-scan dropped, route forwarding, non-integer limit, strict route registration, and the MCP handler (rendering, read-only folder resolution, lineage note, missing strict key).test_mcp_dashboard_registration.py,test_mcp_dashboard_folders.pyandtest_session_control_doc.py.Manual verification
Backend-only, no UI change. The route and handler are exercised end to end through aiohttp in the tests above.
Related Issues
Fixes #15439
Checklist
feat|fix|docs|style|refactor|perf|test|chore|ci|build|revert: ...)Contribution License Agreement