feat(insights): persist complete business context and reusable briefs - #751
feat(insights): persist complete business context and reusable briefs#751izadoesdev wants to merge 15 commits into
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
The latest updates on your projects. Learn more about Unkey Deploy
|
|
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 |
Greptile SummaryThis PR introduces durable, scope-bound PostgreSQL business profiles, compiles and indexes reusable briefs, retains pages discovered during native investigations, and invalidates persisted context during website lifecycle changes.
Confidence Score: 4/5The PR should not merge until concurrent refreshes stop exposing incomplete canonical profiles and the explicit repository-rule violations are corrected. Refresh ownership is represented by overwriting the canonical profile with a brief-less claim, allowing an independent concurrent preparation to consume degraded or unavailable context; the remaining findings concern source-budget enforcement and two mandatory style rules. Files Needing Attention: apps/insights/src/business-profile.ts, apps/insights/src/business-page-retention.test.ts, apps/insights/src/business-profile.integration.test.ts Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
I[Investigation preparation] --> L[Load canonical PostgreSQL profile]
L -->|Fresh| W[Return warm sources and brief]
L -->|Refresh required| C[Write refresh claim]
C --> H[Read homepage and site map]
H --> P[Select additional pages]
P --> B[Compile quotation-based brief]
B --> S[CAS-save complete profile]
S --> M[Index derived brief in Supermemory]
M --> W
R[Semantic recall] --> M
R --> L
A[Native investigation page reads] --> K[Retain bounded newer pages]
K --> L
X[Transfer, domain change, or deletion] --> D[Invalidate durable profile]
D --> T[Retire scoped remote memory]
Reviews (1): Last reviewed commit: "feat(insights): persist full business co..." | Re-trigger Greptile |
8a6c751 to
db72fc7
Compare
Investigations previously reused a short homepage excerpt and discarded deeper business context. Setup, commercial access and identity qualifications could disappear, and a memory-provider outage could remove the profile entirely.
Persist scoped original business sources and a reusable business brief in
website_business_contexts. Supermemory indexes a derived brief; semantic matches hydrate the current Postgres record. Cold preparation selects up to seven additional pages and compiles once. A failed homepage can still use discovered pages, without retries. Warm reads reuse Postgres. Transfers/deletion invalidate the scope; native investigation page reads are retained with revision checks.The compiler produces concise claims and selects bounded passage IDs; code attaches exact original text, eliminating quote-copy and repair loops. Every supporting passage must remain valid or the whole claim is omitted. Astra compiles the cached brief; Terra still selects pages and runs investigations. Investigators receive the original sources plus concise orientation, with no duplicate quote payload. Original sources remain necessary for deciding qualifications.
Validation:
Scope: profile preparation, persistence, source retention and lifecycle tests. Candidate selection and source-reader improvements landed independently in #753/#754. No billing-rule or customer-delivery change in this PR. No unmerged dependency.
Hold merge: apply the additive table before deploying. The verified application/root connection roles lack CREATE on public; the prior attempt failed SQLSTATE 42501 and rolled back. A migration-capable database connection is required. No worker deployment was initiated. Schema SQL, exact evaluated sources, every observable model/tool step, failures, usage and manual reviews are preserved in the local audit archive. Hidden reasoning is omitted. AI-assisted maintainer-directed implementation and independent review.