Add TTM revenue and tighten metric semantics#9
Merged
Conversation
The plugin-based approach was failing because the Claude CLI installation returns 403 and can't add marketplaces. Switch to the simpler prompt-based approach used in organizations gem which doesn't require CLI installation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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
This PR started from adding trailing-twelve-month revenue to
profitable, but it also includes a broader metric audit against the currentpaydata model.It adds
TTM revenue, adds denominator-explicit valuation helpers, makes revenue metrics net of refunds, tightens trial / subscriber / first-monetization semantics, hardens status handling against current Pay lifecycle variants, updates the built-in dashboard, and expands both the README and inline code comments for future maintenance.The latest pass also makes the founder-facing API a bit friendlier with
Profitable.ttmas a shorthand alias forttm_revenue, documents the processor support boundary more explicitly, and removes the large standalone test-helper mirror by extracting shared metric logic into a single implementation file that both production code and tests load.Main Changes
Profitable.ttm_revenueProfitable.ttmas a founder-friendly alias forttm_revenueProfitable.revenue_run_rateProfitable.estimated_arr_valuationProfitable.estimated_ttm_revenue_valuationProfitable.estimated_revenue_run_rate_valuationestimated_valuationas a backwards-compatible ARR aliasamount_refundedis presentnew_customersfrom first monetization date instead of signup datenew_subscribers/new_mrrfrom billable start, not free-trial startends_aton_trial,cancelled, anddeletedlib/profitable/metrics.rbso the standalone test harness exercises the real production implementation instead of a mirrored module copy.ttmaliasValidation
bundle exec rake test308 runs, 449 assertions, 0 failuresbundle exec appraisal pay-11.0 rake test308 runs, 449 assertions, 0 failuresbundle exec appraisal pay-7.3 rake test308 runs, 449 assertions, 0 failuresbundle exec appraisal rails-7.2 rake test308 runs, 449 assertions, 0 failuresDraft Status
Still leaving this as draft until the full CI matrix runs and we decide whether to widen processor coverage further or keep the current support boundary explicit in docs.