fix(insights): preserve canonical replies before public pages - #771
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
2 Skipped Deployments
|
|
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 changes shared-profile reconciliation so eligible canonical team replies are selected before additional public-page excerpts when no subject key is provided.
Confidence Score: 5/5The PR appears safe to merge because the ordering change is bounded to shared-profile reconciliation and the regression test verifies the intended budget behavior. No actionable failures remain; exact-subject recall is unchanged, canonical replies gain the intended priority, and saved-profile, status, issue, and budget behavior remain consistent. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Load shared website context] --> B[Read eligible canonical replies]
B --> C{Subject key present?}
C -- No --> D[Merge canonical replies before public pages]
C -- Yes --> E[Keep exact-subject relevance ordering]
D --> F[Merge saved organization profile]
E --> F
F --> G[Apply bounded context selection]
Reviews (1): Last reviewed commit: "fix(insights): preserve canonical replie..." | Re-trigger Greptile |
Four full public-page excerpts could consume the shared context budget before a current canonical team reply reached investigation selection. Shared-profile reconciliation now merges canonical replies ahead of additional public pages; exact-subject recall retains its existing relevance ordering.
The production
loadWebsiteBusinessProfileregression injects four 4,000-character public pages, a current canonical reply, and a small saved brief. It failed before the fix because the reply disappeared, and now verifies the complete reply, saved brief, homepage and two additional pages survive within the existing 16,000-character budget.Scope: finding 2 only; two files, 37 added lines (5 implementation, 32 regression). No prompt, selector, coverage-planner, shared AI helper or evaluation-harness changes. Based on
origin/stagingat4422cd61d5faa66ee9a40da23f5569e571b12078, with no unmerged dependency. Known overlap: #751 also changes the context loader and budget tests; coordinate its integration after this bounded fix. The parent's selector/evaluation work remains separate.Validation:
bun test apps/insights/src/business-context.test.ts apps/insights/src/business-context-generation.test.ts apps/insights/src/business-aware-selection.test.ts: 56 passed.packages/ai,bun test src/lib/business-context.test.ts: 10 passed, 1 gated DB integration test skipped.bun run lint: passed, including 14 policy tests.bun run check-types: passed, 33 tasks (32 cached, the changed Insights package checked fresh).bun run test: 27 tasks (26 cached); Insights ran fresh with 580 passed, 6 live-model tests skipped, and 0 failures.git diff --check: passed.Validation ran with a clean environment and automatic env-file loading disabled. The first combined test attempt encountered an unbuilt SDK export after 37 passing tests; after the root type-check build supplied the SDK artifact, the full relevant test command passed. No live LLM or production database was used.
Keep draft and do not merge until parent review and its independent fresh selector comparison. AI-assisted implementation and validation; no human verification is claimed.
Summary by cubic
Fixes shared-profile context reconciliation so a current canonical team reply survives ahead of full public-page excerpts, instead of being dropped when four 4,000-character pages consume the 16,000-character budget. The fix applies only when no subject key is provided; exact-subject recall keeps its existing relevance ordering.
Bug Fixes
Written for commit c6e0994. Summary will update on new commits.