feat(sessions): index workflow runs and agents (layer 2 of session intelligence)#284
Conversation
|
|
Rebased/amended: fixed the tool-count lockstep (master gained |
fd3e0e5 to
e20d7a3
Compare
|
The 3 CI failures are git_watch timing flakes inherited from merged #280's auto-sync ( Separately worth flagging: these git_watch timing flakes now live in master (via #280) and will intermittently redden any PR's CI — worth a dedicated determinism fix (inject a clock / assert behavior not wall-time), which the earlier test-robustness workflow diagnosed but couldn't land while git_watch was still unmerged. I can take that as a follow-up to #283. |
Layer 2 of session intelligence (builds on #281's git spans). Indexes Claude Code workflow runs + agents into the session store, attached to the parent thread and to branches/worktrees/commits. Adds the tracedecay_workflows tool (list by thread or git ref, show a run, drill an agent), workflow_run/agent filters on message_search, and a 'sessions unfinished' CLI. Ingest is idempotent + incremental. Tool count 100 -> 101. Verified against ~/.claude: 11 runs / 79 agents. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The set_mtime helper opened files read-only and called set_times, which works on Unix but panics on Windows (adjusting a directory's timestamps needs backup-semantics access). Switch to filetime::set_file_mtime (already a transitive dep; added as an explicit dev-dependency). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
/simplify cleanup (behavior-preserving), converged on by 4 reviewers: - delete WorkflowStatus::from_db (redundant with the infallible from_disk given the status column's CHECK constraint) - reuse crate::sessions::claude::transcript_cwd instead of a byte-copy - promote string_arg/argument_error/tool_json_with_md to handlers/support and share them between session.rs and workflow_query.rs - one shared shared::one_line_truncated (single ellipsis convention) replacing three divergent copies - ProjectRootMatcher resolves the fixed project side's git worktree/common dir once, so the ingest loop stops re-resolving it per run Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Reuse git_scope_exists_clauses for workflow git-scope queries, avoid per-status string allocations, HashSet dedup in roster assembly, and colocate one_line_truncated tests with shared helpers.
f87166f to
c6990c0
Compare
Layer 2 of the session-intelligence work (builds on merged #281's git spans). Indexes Claude Code workflow runs and their agents into the per-project session store, attaching them to the parent thread and — via #281's git spans — to branches/worktrees/commits.
What you can now ask
What's in it
src/sessions/workflow_index.rs):workflow_runs+workflow_agents, version-gated migration mirroring feat(sessions): git-anchored session/LCM correlation #281; idempotent upsert;runs_for_session/run_for_id/agents_for_run+ the git-span joinruns_for_git_scopesrc/sessions/workflow_ingest.rs): discoverssubagents/workflows/<run_id>/dirs during session ingest, parses run meta + result + per-agent transcripts, idempotent + incremental (mtime watermark), fail-open. Verified against real ~/.claude: 11 runs / 79 agents ingested for the authoring sessiontracedecay_workflowsMCP tool (3 modes: thread / git-ref / run-drill) +workflow_run/workflow_agentfilters onmessage_search; taught as rung 7 inmanaging-session-contexttracedecay sessions unfinished(ported from the codex/workflow-state-tool branch)Verification
Cherry-picked clean onto current master (resolved one skill conflict: #280 consolidated
recalling-session-contextintomanaging-session-context, so the workflow rung moved there). clippy --all-targets clean; 29 workflow tests green; full CI matrix running.Fittingly, this makes tonight's own 11-workflow / 79-agent sprawl natively queryable instead of hand-tracked. Design: fact 38. Recovery: session `2c51d204-3565-4a10-833d-d8fbd51620c3`, workflow `wf_d8320cfc-191`.
🤖 Generated with Claude Code