feat(cost-insights): Introduce Cost Insights feature#4253
Draft
jeanduplessis wants to merge 11 commits into
Draft
feat(cost-insights): Introduce Cost Insights feature#4253jeanduplessis wants to merge 11 commits into
jeanduplessis wants to merge 11 commits into
Conversation
da90cf6 to
7185335
Compare
St0rmz1
reviewed
Jun 26, 2026
St0rmz1
reviewed
Jun 26, 2026
St0rmz1
reviewed
Jun 26, 2026
St0rmz1
reviewed
Jun 26, 2026
St0rmz1
reviewed
Jun 26, 2026
St0rmz1
reviewed
Jun 26, 2026
St0rmz1
reviewed
Jun 26, 2026
St0rmz1
reviewed
Jun 26, 2026
St0rmz1
reviewed
Jun 26, 2026
St0rmz1
reviewed
Jun 26, 2026
St0rmz1
reviewed
Jun 26, 2026
St0rmz1
reviewed
Jun 26, 2026
St0rmz1
reviewed
Jun 26, 2026
St0rmz1
reviewed
Jun 26, 2026
St0rmz1
reviewed
Jun 26, 2026
pandemicsyn
requested changes
Jun 26, 2026
pandemicsyn
left a comment
Contributor
There was a problem hiding this comment.
Found additional correctness issues and non-blocking performance warnings after excluding feedback already present on the PR. Database performance warnings are advisory and do not individually block merging.
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.
Summary
Adds owner-scoped Cost Insights for personal users and organizations so authorized users can inspect Credit spend, configure Spend Alerts, review alert episodes, and act on Cost Suggestions.
Verification
Visual Changes
N/A - screenshots were not captured as part of this update.
Reviewer Notes
Run this branch locally
Prerequisites: Docker Desktop must be running,
tmuxmust be installed, and.env.localmust contain a localPOSTGRES_URL. Use Node from.nvmrcand pnpm frompackage.json.git switch jdp/cost-insights && git pull --ff-onlyinstead.git fetch origin jdp/cost-insights git switch --track origin/jdp/cost-insights nvm install nvm use corepack enable pnpm installDefault web URL is
http://localhost:3000. If another Kilo dev stack is running, generate env and start this worktree with a stable automatic offset, then read the actual Next.js port from status output:What the seed creates
pnpm dev:seed cost-insights:spend-evidencecreates a deterministic, owner-scoped fixture containing:[seed:cost-insights] Northstar Labswith owner, billing manager, and member-attributed spend drivers.24h,7d,30d, and90dviews are populated.The command prints
personalLoginPath,organizationLoginPath, owner IDs, organization ID, record counts, and the database target. Prefix a printed login path withhttp://localhost:<nextjs-port>.Seed identities:
cost-insights-owner@example.comcost-insights-billing-manager@example.comcost-insights-member@example.comOrganization ID:
4f2fc143-4b30-4c8a-878b-df89c89c6790.With the default port, use these direct fake-login URLs:
Wait for fake-login account creation to finish before evaluating the page. The owner and billing manager can change settings and review items. The Kilo admin can inspect the organization but must not receive mutation or checkout controls. The regular member exists to exercise contributor attribution and is not authorized to open organization Cost Insights.
Suggested local checks
24h,7d,30d, and90d; zero-spend buckets should have zero-height bars.Seed safety and reset behavior
USE_PRODUCTION_DB=trueand rejects anyPOSTGRES_URLwhose host is not loopback (localhost,127.0.0.1, or::1).pnpm dev:seed cost-insights:spend-evidence.