feat(insights): retain supplied business context on investigations - #767
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: ASSERTIVE Plan: Advanced 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 |
7d33b7e to
bc903d3
Compare
|
The latest updates on your projects. Learn more about Unkey Deploy
|
62e2dab to
030a57b
Compare
Greptile SummaryThis PR adds an optional, bounded business-context snapshot to investigation outcomes and displays that snapshot on each dashboard timeline update.
Confidence Score: 4/5The persistence and prompt-isolation behavior appears sound, but the explicit repository-rule violations must be corrected before merging; the contradictory unavailable-state copy should also be fixed. No blocking behavioral failure was found in snapshot generation, persistence, resume, or model-history isolation. The remaining concerns are misleading unavailable-state UI copy and two categories of explicit test-code rule violations. Files Needing Attention: apps/dashboard/app/(main)/insights/_components/context-used.tsx, apps/insights/src/business-context.integration.test.ts, apps/insights/src/generation-sources.test.ts, apps/insights/src/business-context-generation.test.ts Important Files Changed
Sequence DiagramsequenceDiagram
participant Profile as Business profile
participant Worker as Insights worker
participant Agent as Investigation agent
participant Store as Observation storage
participant UI as Investigation timeline
Worker->>Profile: Load bounded context and revision
Worker->>Agent: Supply context with evidence
Agent-->>Worker: Return structured outcome
Worker->>Worker: Remove authored/previous snapshot
Worker->>Store: Persist outcome with supplied snapshot
Store-->>UI: Return timeline observation
UI->>UI: Render collapsed Business context
Note over Worker,Agent: Prior snapshots are removed from later history prompts
Reviews (1): Last reviewed commit: "fix(dashboard): clarify business context..." | Re-trigger Greptile |
4d59b5b to
ba2ca52
Compare
Description
Investigation observations currently lose the business background supplied to the model. Persist that bounded snapshot in the existing outcome JSON and expose it in a collapsed Business context disclosure on each investigation update, including canonical profile revision/time, supplied text, source names, and recorded URLs.
Generation retains the context from its frozen candidate; resume appends a fresh snapshot without rewriting prior observations. When sources exist, the disclosure says “Background available for this update” and explains once that the snapshot does not identify which facts influenced individual claims. Empty or unavailable snapshots omit the availability introduction and retain their status message and capture time. Application code assigns the snapshot; model-authored output and subsequent observation-history prompts exclude it.
The additions are optional for older investigations. There is no database migration, new API, or additional model turn.
Slice and integration
cf6f7e2201eebe00593c92db3342b2b3c6efe045; the diff contains only this attribution slice and its copy follow-up.team | website | mixedorigin. Both canonical background and structured team-context chunks retainprofileVersion.Final validation
Review notes
AI assistance: Codex implemented, reviewed, and tested this maintainer-directed slice and prepared this PR. Automated validation is described above; human verification is not implied.