You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fix(metrics-core): normalize user capacity by the configured lookback - #3488
User carrying capacity now converts the full lookback period's NRR into daily churn using lookbackDays. Constant daily inflow of 100 and decline of 0.01/day therefore produce capacity 10000 for 1, 7, 30 and 60-day samples. Days retain the existing local calendar-date semantics across DST; the 30-day result and invalid-input failure behavior are preserved.
Validation
Standard profile: bounded single-package formula correction, with no public API shape, provider query or dependency changes. Includes a metrics-core patch changeset.
Negative control: the original formula fails the 1/7/60-day regressions; 30 days passes.
TZ=America/New_York pnpm --dir packages/metrics-core exec vitest run src/tests/CarryingCapacity.spec.ts: 46 tests pass, including calendar windows crossing spring DST.
Affected package typecheck/lint and 10-package dependency build: pass. Initial missing declaration artifacts were repaired by building dependencies.
Independent code review: PASS; repository/retention boundaries and callers inspected, no findings.
Final source cleanup review: no changes required.
Review companion selected architecture/public API/repository gates: pass. pnpm check: 28 pass, 1 not applicable; the first architecture check overlapped a dependency rebuild and passed when rerun after the build.
Normal pre-push full tests: 311/311 tasks pass. Guarded full typecheck: 328/328 tasks pass; tracked files unchanged.
The generated API reference correction documents the logarithmic formula and local calendar-day configuration. pnpm docs:api:check passes, and the metrics-core source/test tree is identical to the reviewed implementation. The earlier local Chromium shutdown timeout did not recur: the unchanged browser test passes all three tests in 927ms. Normal push completed for head fc9f999a1329beaaab8ae07252103b64cdf074d0: full tests pass 311/311 tasks, guarded full typecheck passes 328/328 tasks, and the checkout remains clean.
Visual evidence
The exact two generated Markdown files render through the existing Astro/Starlight configuration using the repository's isolated build-root pattern. Screenshots show locale-valid test fixture routes at 1440×1000; no console/page errors or horizontal overflow were observed. This copy-only correction introduces no interaction change.
Known pre-existing limitation: canonical /api/... pages return 404 because TypeDoc root output does not match Starlight's locale prefix. The fixture verifies the changed Markdown rendering, not deployment routing, and does not change the product's route behavior.
All required checks and selected optional checks pass on this head: CI, review companion, and benchmark. GitHub reports MERGEABLE/CLEAN. No unresolved review threads or requested changes remain; actual rules require zero approvals.
Cumulative trunk drift includes unrelated metric-expression grouping, admin generation, QStash failure handling, Problem registry metadata, HTTP nullable responses, saga compensation and protocol/CLI schema compatibility classification. It does not interact with the carrying-capacity calculation or retention/provider contract. No rebase was needed; source review and regression evidence remains applicable to the byte-identical metrics-core source/test tree.
Summary by CodeRabbit
개선 사항
사용자 수용량 계산에서 고정된 30일 기준 대신 설정된 조회 기간을 사용해 일일 이탈률을 계산합니다.
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.
📝 Walkthrough
📝 Walkthrough
📝 Walkthrough
📝 Walkthrough
📝 Walkthrough
📝 Walkthrough
📝 Walkthrough
📝 Walkthrough
📝 Walkthrough
Walkthrough
사용자 수용 용량 계산에서 일일 이탈률을 산출할 때 고정된 30일 대신 설정된 lookbackDays를 사용합니다. 1일, 7일, 30일, 60일 기간을 검증하는 테스트와 @croco/metrics-core의 patch changeset을 추가합니다.
No actionable merge-blocking risk is identified; the change is ready to merge after normal checks.
Pre-merge checks | 5
✅ Passed checks (5 passed)
Check name
Status
Explanation
Linked Issues check
직접 연결된 활성 이슈 #3218의 코딩 요구사항을 충족합니다. calculateUserCC는 전체 lookback 기간의 retention.nrr를 설정된 lookbackDays로 환산합니다. 이에 따라 1, 7, 30, 60일 테스트에서 동일한 일일 이탈률과 capacity를 검증합니다. 30일 계산 결과와 로컬 달력 날짜 및 DST 의미를 …
Out of Scope Changes check
변경 범위는 #3218의 기간 환산 오류 수정에 한정됩니다. 소스 변경은 calculateUserCC의 공식 설명과 lookbackDays 사용이며, 테스트는 해당 기간 불변성과 기존 동작을 검증합니다. metrics-core patch changeset도 이 수정의 배포 문서입니다. 관련 없는 도메인 모델, RevenueCC, provider …
Docstring Coverage
No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check. Docstring coverage is scoped to functions touched by this diff. Analyzed 0 functions across 2…
Description Check
Check skipped - CodeRabbit’s high-level summary is enabled.
Title check
제목은 설정된 lookback을 사용해 사용자 수용 용량을 정규화하는 핵심 변경을 정확하고 간결하게 설명합니다.
✨ Finishing Touches 💡 1
📝 Generate docstrings
Commit to this branch
Create a new PR
🧪 Generate unit tests (beta)
Commit to this branch
Create a new PR
🛠️ Fix failing CI checks 💡
Commit to this branch
Create a new PR
Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
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.
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
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.
Closes #3218.
User carrying capacity now converts the full lookback period's NRR into daily churn using
lookbackDays. Constant daily inflow of 100 and decline of 0.01/day therefore produce capacity 10000 for 1, 7, 30 and 60-day samples. Days retain the existing local calendar-date semantics across DST; the 30-day result and invalid-input failure behavior are preserved.Validation
Standard profile: bounded single-package formula correction, with no public API shape, provider query or dependency changes. Includes a metrics-core patch changeset.
TZ=UTC pnpm --filter @croco/metrics-core test: 330 tests pass.TZ=America/New_York pnpm --dir packages/metrics-core exec vitest run src/tests/CarryingCapacity.spec.ts: 46 tests pass, including calendar windows crossing spring DST.pnpm check: 28 pass, 1 not applicable; the first architecture check overlapped a dependency rebuild and passed when rerun after the build.The generated API reference correction documents the logarithmic formula and local calendar-day configuration.
pnpm docs:api:checkpasses, and the metrics-core source/test tree is identical to the reviewed implementation. The earlier local Chromium shutdown timeout did not recur: the unchanged browser test passes all three tests in 927ms. Normal push completed for headfc9f999a1329beaaab8ae07252103b64cdf074d0: full tests pass 311/311 tasks, guarded full typecheck passes 328/328 tasks, and the checkout remains clean.Visual evidence
The exact two generated Markdown files render through the existing Astro/Starlight configuration using the repository's isolated build-root pattern. Screenshots show locale-valid test fixture routes at 1440×1000; no console/page errors or horizontal overflow were observed. This copy-only correction introduces no interaction change.
/en/api/metrics-core/src/classes/carryingcapacitycalculator/./en/api/metrics-core/src/type-aliases/userccconfig/.Known pre-existing limitation: canonical
/api/...pages return 404 because TypeDoc root output does not match Starlight's locale prefix. The fixture verifies the changed Markdown rendering, not deployment routing, and does not change the product's route behavior.CI and merge status
Head:
fc9f999a1329beaaab8ae07252103b64cdf074d0. Assessed base:6d6863ffa1f760e63ddfdde491e263ee99456a3a.All required checks and selected optional checks pass on this head: CI, review companion, and benchmark. GitHub reports MERGEABLE/CLEAN. No unresolved review threads or requested changes remain; actual rules require zero approvals.
Cumulative trunk drift includes unrelated metric-expression grouping, admin generation, QStash failure handling, Problem registry metadata, HTTP nullable responses, saga compensation and protocol/CLI schema compatibility classification. It does not interact with the carrying-capacity calculation or retention/provider contract. No rebase was needed; source review and regression evidence remains applicable to the byte-identical metrics-core source/test tree.
Summary by CodeRabbit