feat(skills): durable reflection-run record with activity timeline surface - #641
Draft
jamiepine wants to merge 2 commits into
Draft
feat(skills): durable reflection-run record with activity timeline surface#641jamiepine wants to merge 2 commits into
jamiepine wants to merge 2 commits into
Conversation
…rface Add a persisted reflection_run lifecycle table and event for the skill-reflection pump. Every reflection pass (riding the memory- persistence branch) now records agent/channel identity, trigger provenance, referenced worker IDs, start/end timestamps, terminal status (success/no_op/error), declared rationale distinct from observed actions, outcome summary, and affected skill identifiers. ReflectionRunCompleted flows through the shared ProcessEvent bus, the existing ApiEvent SSE pipeline, and renders as an inline card in the portal timeline — same pattern as chronicle checkpoints, no parallel event system. Deferred curation (snapshots, stale/archive passes, consolidation) and full SkillInspector surface remain for follow-up PRs as documented in the updated skill-lifecycle.md shipped-status section.
Contributor
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
The reflection_run timeline type is client-only (not in the OpenAPI TimelineItem union). Use double-cast through unknown for pushItem and Record<string,unknown> for the type discriminator in PortalTimeline, matching the existing pattern used by checkpoint rendering.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Adds a persisted
reflection_runstable and event for the skill-reflection pump, closing the remaining user-visible part of the shipped reflection loop. Every reflection pass now records its lifecycle and surfaces in the portal timeline.Changes
Database: New
reflection_runsmigration with agent/channel identity, trigger source (turn_work/worker_success/reflection), referenced worker IDs (JSON), start/end timestamps, terminal status (success/no_op/error/cancelled), declared rationale (separate from observed actions), outcome summary, affected skill identifiers, and token usage slot.Event:
ProcessEvent::ReflectionRunCompletedon the shared event bus — same pattern asBranchResult,WorkerComplete, etc. — piped through the existingApiEventSSE pipeline.ApiEvent::ReflectionRunCompletedwith thereflection_run_completedSSE event type.Persistence:
ReflectionRunLoggerinconversation/history.rs, fire-and-forget matchingProcessRunLogger. Write-on-start (INSERT), guarded completion update (UPDATE … WHERE status = 'running'), preventing duplicate completions.UI:
InlineReflectionRunCardinPortalTimeline.tsx— a quiet divider bar showing "Learned: …" / "No change: …" / "Error: …" — same inline pattern as chronicle checkpoints, no parallel event system.Validation
cargo fmt --check— cleancargo check— cleancargo test --lib— 594 passed, 0 failedcargo test --test '*'— 117 passed, 0 failedbun run build— cleanjust preflight— passedjust gate-pr— all gates green (fmt, check, migration conflicts, lib tests, integration tests)Intentional deferments (documented in
skill-lifecycle.md)POST /agents/skills/write,CreateSkill.tsx, fullSkillInspectorusage row,write_approvalstaging modepin/adopt/archive/restorecommandsDesign invariants preserved
WHERE status = 'running'