@lssm/module.lifecycle-core 0.0.0-canary-20251217063201 → 0.0.0-canary-20251217072406

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1,65 @@
1
- import{e,n as t,t as n}from"../libs/lifecycle/dist/types/axes.js";import"../libs/lifecycle/dist/index.js";const r={product:e.Sketch,company:n.Solo,capital:t.Bootstrapped};var i=class{options;constructor(e){this.options=e}async collect(e={}){let t={...r,...e.axes??{}},n=[],i=[...e.signals??[]],s={...e.questionnaireAnswers??{}};if(e.metrics&&n.push(e.metrics),this.options.analyticsAdapter){let e=await this.options.analyticsAdapter.fetch();e.axes&&Object.assign(t,e.axes),e.metrics&&n.push(e.metrics),e.signals&&i.push(...e.signals)}if(this.options.questionnaireAdapter){let e=await this.options.questionnaireAdapter.fetch();e.axes&&Object.assign(t,e.axes),e.signals&&i.push(...e.signals),Object.assign(s,e.answers)}if(this.options.intentAdapter){let e=await this.options.intentAdapter.fetch();e.signals&&i.push(...e.signals)}return{axes:t,metrics:a(n),signals:o(i),questionnaireAnswers:Object.keys(s).length?s:void 0}}};const a=e=>e.reduce((e,t)=>(Object.entries(t??{}).forEach(([t,n])=>{n!=null&&(e[t]=n)}),e),{}),o=e=>{let t=new Set;return e.filter(e=>e.id?t.has(e.id)?!1:(t.add(e.id),!0):!0)};export{i as StageSignalCollector};
1
+ import { CapitalPhase, CompanyPhase, ProductPhase } from "../libs/lifecycle/dist/types/axes.js";
2
+ import "../libs/lifecycle/dist/index.js";
3
+
4
+ //#region src/collectors/signal-collector.ts
5
+ const DEFAULT_AXES = {
6
+ product: ProductPhase.Sketch,
7
+ company: CompanyPhase.Solo,
8
+ capital: CapitalPhase.Bootstrapped
9
+ };
10
+ var StageSignalCollector = class {
11
+ options;
12
+ constructor(options) {
13
+ this.options = options;
14
+ }
15
+ async collect(input = {}) {
16
+ const axes = {
17
+ ...DEFAULT_AXES,
18
+ ...input.axes ?? {}
19
+ };
20
+ const metricsSnapshots = [];
21
+ const aggregatedSignals = [...input.signals ?? []];
22
+ const questionnaireAnswers = { ...input.questionnaireAnswers ?? {} };
23
+ if (input.metrics) metricsSnapshots.push(input.metrics);
24
+ if (this.options.analyticsAdapter) {
25
+ const result = await this.options.analyticsAdapter.fetch();
26
+ if (result.axes) Object.assign(axes, result.axes);
27
+ if (result.metrics) metricsSnapshots.push(result.metrics);
28
+ if (result.signals) aggregatedSignals.push(...result.signals);
29
+ }
30
+ if (this.options.questionnaireAdapter) {
31
+ const result = await this.options.questionnaireAdapter.fetch();
32
+ if (result.axes) Object.assign(axes, result.axes);
33
+ if (result.signals) aggregatedSignals.push(...result.signals);
34
+ Object.assign(questionnaireAnswers, result.answers);
35
+ }
36
+ if (this.options.intentAdapter) {
37
+ const result = await this.options.intentAdapter.fetch();
38
+ if (result.signals) aggregatedSignals.push(...result.signals);
39
+ }
40
+ return {
41
+ axes,
42
+ metrics: mergeMetricSnapshots(metricsSnapshots),
43
+ signals: dedupeSignals(aggregatedSignals),
44
+ questionnaireAnswers: Object.keys(questionnaireAnswers).length ? questionnaireAnswers : void 0
45
+ };
46
+ }
47
+ };
48
+ const mergeMetricSnapshots = (snapshots) => snapshots.reduce((acc, snapshot) => {
49
+ Object.entries(snapshot ?? {}).forEach(([key, value]) => {
50
+ if (value !== void 0 && value !== null) acc[key] = value;
51
+ });
52
+ return acc;
53
+ }, {});
54
+ const dedupeSignals = (signals) => {
55
+ const seen = /* @__PURE__ */ new Set();
56
+ return signals.filter((signal) => {
57
+ if (!signal.id) return true;
58
+ if (seen.has(signal.id)) return false;
59
+ seen.add(signal.id);
60
+ return true;
61
+ });
62
+ };
63
+
64
+ //#endregion
65
+ export { StageSignalCollector };
@@ -1 +1,73 @@
1
- var e=[{id:`stage0-problem-statement`,stage:0,category:`product`,title:`Write the pain statement`,description:`Capture the clearest description of the top problem in the customer’s own words.`,priority:1,actionItems:[`Interview at least 5 ideal customers`,`Synthesize quotes into a one-page brief`]},{id:`stage1-prototype-loop`,stage:1,category:`product`,title:`Prototype feedback loop`,description:`Ship a clickable prototype and gather 3 rounds of feedback.`,priority:2,actionItems:[`Create a low-fidelity prototype`,`Schedule standing feedback calls`]},{id:`stage2-activation`,stage:2,category:`operations`,title:`Activation checklist`,description:`Define the minimum steps required for a new user to succeed.`,priority:1,actionItems:[`Document onboarding flow`,`Instrument activation analytics`]},{id:`stage3-retention-narrative`,stage:3,category:`product`,title:`Retention narrative`,description:`Create the before/after story that proves why users stay.`,priority:2,actionItems:[`Interview 3 retained users`,`Publish a one-pager with concrete metrics`]},{id:`stage4-growth-loop`,stage:4,category:`growth`,title:`Install a growth loop`,description:`Stand up a repeatable acquisition → activation → referral motion.`,priority:1,actionItems:[`Define loop metrics`,`Assign owners for each stage`,`Review weekly`]},{id:`stage5-platform-blueprint`,stage:5,category:`product`,title:`Platform blueprint`,description:`Align on APIs, integrations, and governance for partners.`,priority:2,actionItems:[`Create integration scoring rubric`,`Publish partner onboarding checklist`]},{id:`stage6-renewal-ops`,stage:6,category:`operations`,title:`Renewal operating rhythm`,description:`Decide whether to optimize, reinvest, or sunset each major surface.`,priority:1,actionItems:[`Hold quarterly renewal review`,`Document reinvestment bets`]}];export{e as default};
1
+ //#region src/data/milestones-catalog.json
2
+ var milestones_catalog_default = [
3
+ {
4
+ "id": "stage0-problem-statement",
5
+ "stage": 0,
6
+ "category": "product",
7
+ "title": "Write the pain statement",
8
+ "description": "Capture the clearest description of the top problem in the customer’s own words.",
9
+ "priority": 1,
10
+ "actionItems": ["Interview at least 5 ideal customers", "Synthesize quotes into a one-page brief"]
11
+ },
12
+ {
13
+ "id": "stage1-prototype-loop",
14
+ "stage": 1,
15
+ "category": "product",
16
+ "title": "Prototype feedback loop",
17
+ "description": "Ship a clickable prototype and gather 3 rounds of feedback.",
18
+ "priority": 2,
19
+ "actionItems": ["Create a low-fidelity prototype", "Schedule standing feedback calls"]
20
+ },
21
+ {
22
+ "id": "stage2-activation",
23
+ "stage": 2,
24
+ "category": "operations",
25
+ "title": "Activation checklist",
26
+ "description": "Define the minimum steps required for a new user to succeed.",
27
+ "priority": 1,
28
+ "actionItems": ["Document onboarding flow", "Instrument activation analytics"]
29
+ },
30
+ {
31
+ "id": "stage3-retention-narrative",
32
+ "stage": 3,
33
+ "category": "product",
34
+ "title": "Retention narrative",
35
+ "description": "Create the before/after story that proves why users stay.",
36
+ "priority": 2,
37
+ "actionItems": ["Interview 3 retained users", "Publish a one-pager with concrete metrics"]
38
+ },
39
+ {
40
+ "id": "stage4-growth-loop",
41
+ "stage": 4,
42
+ "category": "growth",
43
+ "title": "Install a growth loop",
44
+ "description": "Stand up a repeatable acquisition → activation → referral motion.",
45
+ "priority": 1,
46
+ "actionItems": [
47
+ "Define loop metrics",
48
+ "Assign owners for each stage",
49
+ "Review weekly"
50
+ ]
51
+ },
52
+ {
53
+ "id": "stage5-platform-blueprint",
54
+ "stage": 5,
55
+ "category": "product",
56
+ "title": "Platform blueprint",
57
+ "description": "Align on APIs, integrations, and governance for partners.",
58
+ "priority": 2,
59
+ "actionItems": ["Create integration scoring rubric", "Publish partner onboarding checklist"]
60
+ },
61
+ {
62
+ "id": "stage6-renewal-ops",
63
+ "stage": 6,
64
+ "category": "operations",
65
+ "title": "Renewal operating rhythm",
66
+ "description": "Decide whether to optimize, reinvest, or sunset each major surface.",
67
+ "priority": 1,
68
+ "actionItems": ["Hold quarterly renewal review", "Document reinvestment bets"]
69
+ }
70
+ ];
71
+
72
+ //#endregion
73
+ export { milestones_catalog_default as default };
@@ -1 +1,169 @@
1
- var e={Exploration:{base:.35,metrics:{activeUsers:{weight:-.3,direction:`lte`,threshold:5},customerCount:{weight:-.2,direction:`lte`,threshold:3},teamSize:{weight:-.1,direction:`lte`,threshold:3}},signalKinds:{qualitative:.4,metric:.1}},ProblemSolutionFit:{base:.4,metrics:{activeUsers:{weight:.2,direction:`gte`,threshold:5},customerCount:{weight:.2,direction:`gte`,threshold:3}},signalKinds:{qualitative:.3,event:.1}},MvpEarlyTraction:{base:.45,metrics:{activeUsers:{weight:.25,direction:`gte`,threshold:25},weeklyActiveUsers:{weight:.25,direction:`gte`,threshold:20},retentionRate:{weight:.2,direction:`gte`,threshold:.25}},signalKinds:{metric:.15,event:.1}},ProductMarketFit:{base:.5,metrics:{retentionRate:{weight:.35,direction:`gte`,threshold:.45},monthlyRecurringRevenue:{weight:.25,direction:`gte`,threshold:1e4},customerCount:{weight:.2,direction:`gte`,threshold:30}},signalKinds:{metric:.15,event:.1}},GrowthScaleUp:{base:.55,metrics:{retentionRate:{weight:.2,direction:`gte`,threshold:.55},monthlyRecurringRevenue:{weight:.3,direction:`gte`,threshold:5e4},teamSize:{weight:.15,direction:`gte`,threshold:15}},signalKinds:{event:.2,metric:.15}},ExpansionPlatform:{base:.6,metrics:{monthlyRecurringRevenue:{weight:.35,direction:`gte`,threshold:15e4},customerCount:{weight:.2,direction:`gte`,threshold:100},teamSize:{weight:.15,direction:`gte`,threshold:40}},signalKinds:{event:.2,milestone:.1}},MaturityRenewal:{base:.6,metrics:{monthlyRecurringRevenue:{weight:.25,direction:`gte`,threshold:25e4},teamSize:{weight:.15,direction:`gte`,threshold:80},burnMultiple:{weight:.2,direction:`lte`,threshold:1.5}},signalKinds:{event:.2,milestone:.15}}};export{e as default};
1
+ //#region src/data/stage-weights.json
2
+ var stage_weights_default = {
3
+ Exploration: {
4
+ "base": .35,
5
+ "metrics": {
6
+ "activeUsers": {
7
+ "weight": -.3,
8
+ "direction": "lte",
9
+ "threshold": 5
10
+ },
11
+ "customerCount": {
12
+ "weight": -.2,
13
+ "direction": "lte",
14
+ "threshold": 3
15
+ },
16
+ "teamSize": {
17
+ "weight": -.1,
18
+ "direction": "lte",
19
+ "threshold": 3
20
+ }
21
+ },
22
+ "signalKinds": {
23
+ "qualitative": .4,
24
+ "metric": .1
25
+ }
26
+ },
27
+ ProblemSolutionFit: {
28
+ "base": .4,
29
+ "metrics": {
30
+ "activeUsers": {
31
+ "weight": .2,
32
+ "direction": "gte",
33
+ "threshold": 5
34
+ },
35
+ "customerCount": {
36
+ "weight": .2,
37
+ "direction": "gte",
38
+ "threshold": 3
39
+ }
40
+ },
41
+ "signalKinds": {
42
+ "qualitative": .3,
43
+ "event": .1
44
+ }
45
+ },
46
+ MvpEarlyTraction: {
47
+ "base": .45,
48
+ "metrics": {
49
+ "activeUsers": {
50
+ "weight": .25,
51
+ "direction": "gte",
52
+ "threshold": 25
53
+ },
54
+ "weeklyActiveUsers": {
55
+ "weight": .25,
56
+ "direction": "gte",
57
+ "threshold": 20
58
+ },
59
+ "retentionRate": {
60
+ "weight": .2,
61
+ "direction": "gte",
62
+ "threshold": .25
63
+ }
64
+ },
65
+ "signalKinds": {
66
+ "metric": .15,
67
+ "event": .1
68
+ }
69
+ },
70
+ ProductMarketFit: {
71
+ "base": .5,
72
+ "metrics": {
73
+ "retentionRate": {
74
+ "weight": .35,
75
+ "direction": "gte",
76
+ "threshold": .45
77
+ },
78
+ "monthlyRecurringRevenue": {
79
+ "weight": .25,
80
+ "direction": "gte",
81
+ "threshold": 1e4
82
+ },
83
+ "customerCount": {
84
+ "weight": .2,
85
+ "direction": "gte",
86
+ "threshold": 30
87
+ }
88
+ },
89
+ "signalKinds": {
90
+ "metric": .15,
91
+ "event": .1
92
+ }
93
+ },
94
+ GrowthScaleUp: {
95
+ "base": .55,
96
+ "metrics": {
97
+ "retentionRate": {
98
+ "weight": .2,
99
+ "direction": "gte",
100
+ "threshold": .55
101
+ },
102
+ "monthlyRecurringRevenue": {
103
+ "weight": .3,
104
+ "direction": "gte",
105
+ "threshold": 5e4
106
+ },
107
+ "teamSize": {
108
+ "weight": .15,
109
+ "direction": "gte",
110
+ "threshold": 15
111
+ }
112
+ },
113
+ "signalKinds": {
114
+ "event": .2,
115
+ "metric": .15
116
+ }
117
+ },
118
+ ExpansionPlatform: {
119
+ "base": .6,
120
+ "metrics": {
121
+ "monthlyRecurringRevenue": {
122
+ "weight": .35,
123
+ "direction": "gte",
124
+ "threshold": 15e4
125
+ },
126
+ "customerCount": {
127
+ "weight": .2,
128
+ "direction": "gte",
129
+ "threshold": 100
130
+ },
131
+ "teamSize": {
132
+ "weight": .15,
133
+ "direction": "gte",
134
+ "threshold": 40
135
+ }
136
+ },
137
+ "signalKinds": {
138
+ "event": .2,
139
+ "milestone": .1
140
+ }
141
+ },
142
+ MaturityRenewal: {
143
+ "base": .6,
144
+ "metrics": {
145
+ "monthlyRecurringRevenue": {
146
+ "weight": .25,
147
+ "direction": "gte",
148
+ "threshold": 25e4
149
+ },
150
+ "teamSize": {
151
+ "weight": .15,
152
+ "direction": "gte",
153
+ "threshold": 80
154
+ },
155
+ "burnMultiple": {
156
+ "weight": .2,
157
+ "direction": "lte",
158
+ "threshold": 1.5
159
+ }
160
+ },
161
+ "signalKinds": {
162
+ "event": .2,
163
+ "milestone": .15
164
+ }
165
+ }
166
+ };
167
+
168
+ //#endregion
169
+ export { stage_weights_default as default };
package/dist/index.js CHANGED
@@ -1 +1,6 @@
1
- import{StageSignalCollector as e}from"./collectors/signal-collector.js";import{StageScorer as t}from"./scoring/stage-scorer.js";import{LifecycleMilestonePlanner as n}from"./planning/milestone-planner.js";import{LifecycleOrchestrator as r}from"./orchestrator/lifecycle-orchestrator.js";export{n as LifecycleMilestonePlanner,r as LifecycleOrchestrator,t as StageScorer,e as StageSignalCollector};
1
+ import { StageSignalCollector } from "./collectors/signal-collector.js";
2
+ import { StageScorer } from "./scoring/stage-scorer.js";
3
+ import { LifecycleMilestonePlanner } from "./planning/milestone-planner.js";
4
+ import { LifecycleOrchestrator } from "./orchestrator/lifecycle-orchestrator.js";
5
+
6
+ export { LifecycleMilestonePlanner, LifecycleOrchestrator, StageScorer, StageSignalCollector };
@@ -1 +1,5 @@
1
- import{e,n as t}from"./types/stages.js";import{e as n,n as r,t as i}from"./types/axes.js";import"./types/signals.js";import"./types/milestones.js";import"./utils/formatters.js";
1
+ import { LIFECYCLE_STAGE_META, LifecycleStage } from "./types/stages.js";
2
+ import { CapitalPhase, CompanyPhase, ProductPhase } from "./types/axes.js";
3
+ import "./types/signals.js";
4
+ import "./types/milestones.js";
5
+ import "./utils/formatters.js";
@@ -1 +1,28 @@
1
- let e=function(e){return e.Sketch=`Sketch`,e.Prototype=`Prototype`,e.Mvp=`MVP`,e.V1=`V1`,e.Ecosystem=`Ecosystem`,e}({}),t=function(e){return e.Solo=`Solo`,e.TinyTeam=`TinyTeam`,e.FunctionalOrg=`FunctionalOrg`,e.MultiTeam=`MultiTeam`,e.Bureaucratic=`Bureaucratic`,e}({}),n=function(e){return e.Bootstrapped=`Bootstrapped`,e.PreSeed=`PreSeed`,e.Seed=`Seed`,e.SeriesAorB=`SeriesAorB`,e.LateStage=`LateStage`,e}({});export{e,n,t};
1
+ //#region ../../libs/lifecycle/dist/types/axes.js
2
+ let ProductPhase = /* @__PURE__ */ function(ProductPhase$1) {
3
+ ProductPhase$1["Sketch"] = "Sketch";
4
+ ProductPhase$1["Prototype"] = "Prototype";
5
+ ProductPhase$1["Mvp"] = "MVP";
6
+ ProductPhase$1["V1"] = "V1";
7
+ ProductPhase$1["Ecosystem"] = "Ecosystem";
8
+ return ProductPhase$1;
9
+ }({});
10
+ let CompanyPhase = /* @__PURE__ */ function(CompanyPhase$1) {
11
+ CompanyPhase$1["Solo"] = "Solo";
12
+ CompanyPhase$1["TinyTeam"] = "TinyTeam";
13
+ CompanyPhase$1["FunctionalOrg"] = "FunctionalOrg";
14
+ CompanyPhase$1["MultiTeam"] = "MultiTeam";
15
+ CompanyPhase$1["Bureaucratic"] = "Bureaucratic";
16
+ return CompanyPhase$1;
17
+ }({});
18
+ let CapitalPhase = /* @__PURE__ */ function(CapitalPhase$1) {
19
+ CapitalPhase$1["Bootstrapped"] = "Bootstrapped";
20
+ CapitalPhase$1["PreSeed"] = "PreSeed";
21
+ CapitalPhase$1["Seed"] = "Seed";
22
+ CapitalPhase$1["SeriesAorB"] = "SeriesAorB";
23
+ CapitalPhase$1["LateStage"] = "LateStage";
24
+ return CapitalPhase$1;
25
+ }({});
26
+
27
+ //#endregion
28
+ export { CapitalPhase, CompanyPhase, ProductPhase };
@@ -1 +1 @@
1
- import"./stages.js";
1
+ import "./stages.js";
@@ -1 +1 @@
1
- import"./stages.js";
1
+ import "./stages.js";
@@ -1 +1,151 @@
1
- let e=function(e){return e[e.Exploration=0]=`Exploration`,e[e.ProblemSolutionFit=1]=`ProblemSolutionFit`,e[e.MvpEarlyTraction=2]=`MvpEarlyTraction`,e[e.ProductMarketFit=3]=`ProductMarketFit`,e[e.GrowthScaleUp=4]=`GrowthScaleUp`,e[e.ExpansionPlatform=5]=`ExpansionPlatform`,e[e.MaturityRenewal=6]=`MaturityRenewal`,e}({});e.Exploration,e.ProblemSolutionFit,e.MvpEarlyTraction,e.ProductMarketFit,e.GrowthScaleUp,e.ExpansionPlatform,e.MaturityRenewal;const t={[e.Exploration]:{id:e.Exploration,order:0,slug:`exploration`,name:`Exploration / Ideation`,question:`Is there a problem worth my time?`,signals:[`20+ discovery interviews`,`Clear problem statement`,`Named ICP`],traps:[`Branding before discovery`,`Premature tooling decisions`],focusAreas:[`Customer discovery`,`Problem definition`,`Segment clarity`]},[e.ProblemSolutionFit]:{id:e.ProblemSolutionFit,order:1,slug:`problem-solution-fit`,name:`Problem–Solution Fit`,question:`Do people care enough about this solution?`,signals:[`Prototype reuse`,`Referral energy`,`Pre-pay interest`],traps:[`“Market is huge” without users`,`Skipping qualitative loops`],focusAreas:[`Solution hypothesis`,`Value messaging`,`Feedback capture`]},[e.MvpEarlyTraction]:{id:e.MvpEarlyTraction,order:2,slug:`mvp-early-traction`,name:`MVP & Early Traction`,question:`Can we get real usage and learn fast?`,signals:[`20–50 named active users`,`Weekly releases`,`Noisy feedback`],traps:[`Overbuilt infra for 10 users`,`Undefined retention metric`],focusAreas:[`Activation`,`Cohort tracking`,`Feedback rituals`]},[e.ProductMarketFit]:{id:e.ProductMarketFit,order:3,slug:`product-market-fit`,name:`Product–Market Fit`,question:`Is this pulling us forward?`,signals:[`Retention without heroics`,`Organic word-of-mouth`,`Value stories`],traps:[`Hero growth that does not scale`,`Ignoring churn signals`],focusAreas:[`Retention`,`Reliability`,`ICP clarity`]},[e.GrowthScaleUp]:{id:e.GrowthScaleUp,order:4,slug:`growth-scale-up`,name:`Growth / Scale-up`,question:`Can we grow this repeatably?`,signals:[`Predictable channels`,`Specialized hires`,`Unit economics on track`],traps:[`Paid spend masking retention gaps`,`Infra debt blocking launches`],focusAreas:[`Ops systems`,`Growth loops`,`Reliability engineering`]},[e.ExpansionPlatform]:{id:e.ExpansionPlatform,order:5,slug:`expansion-platform`,name:`Expansion / Platform`,question:`What is the next growth curve?`,signals:[`Stable core metrics`,`Partner/API demand`,`Ecosystem pull`],traps:[`Platform theater before wedge is solid`],focusAreas:[`Partnerships`,`APIs`,`New market validation`]},[e.MaturityRenewal]:{id:e.MaturityRenewal,order:6,slug:`maturity-renewal`,name:`Maturity / Renewal`,question:`Optimize, reinvent, or sunset?`,signals:[`Margin focus`,`Portfolio bets`,`Narrative refresh`],traps:[`Assuming past success is enough`],focusAreas:[`Cost optimization`,`Reinvention bets`,`Sunset planning`]}};export{e,t as n};
1
+ //#region ../../libs/lifecycle/dist/types/stages.js
2
+ let LifecycleStage = /* @__PURE__ */ function(LifecycleStage$1) {
3
+ LifecycleStage$1[LifecycleStage$1["Exploration"] = 0] = "Exploration";
4
+ LifecycleStage$1[LifecycleStage$1["ProblemSolutionFit"] = 1] = "ProblemSolutionFit";
5
+ LifecycleStage$1[LifecycleStage$1["MvpEarlyTraction"] = 2] = "MvpEarlyTraction";
6
+ LifecycleStage$1[LifecycleStage$1["ProductMarketFit"] = 3] = "ProductMarketFit";
7
+ LifecycleStage$1[LifecycleStage$1["GrowthScaleUp"] = 4] = "GrowthScaleUp";
8
+ LifecycleStage$1[LifecycleStage$1["ExpansionPlatform"] = 5] = "ExpansionPlatform";
9
+ LifecycleStage$1[LifecycleStage$1["MaturityRenewal"] = 6] = "MaturityRenewal";
10
+ return LifecycleStage$1;
11
+ }({});
12
+ const LIFECYCLE_STAGE_ORDER = [
13
+ LifecycleStage.Exploration,
14
+ LifecycleStage.ProblemSolutionFit,
15
+ LifecycleStage.MvpEarlyTraction,
16
+ LifecycleStage.ProductMarketFit,
17
+ LifecycleStage.GrowthScaleUp,
18
+ LifecycleStage.ExpansionPlatform,
19
+ LifecycleStage.MaturityRenewal
20
+ ];
21
+ const LIFECYCLE_STAGE_META = {
22
+ [LifecycleStage.Exploration]: {
23
+ id: LifecycleStage.Exploration,
24
+ order: 0,
25
+ slug: "exploration",
26
+ name: "Exploration / Ideation",
27
+ question: "Is there a problem worth my time?",
28
+ signals: [
29
+ "20+ discovery interviews",
30
+ "Clear problem statement",
31
+ "Named ICP"
32
+ ],
33
+ traps: ["Branding before discovery", "Premature tooling decisions"],
34
+ focusAreas: [
35
+ "Customer discovery",
36
+ "Problem definition",
37
+ "Segment clarity"
38
+ ]
39
+ },
40
+ [LifecycleStage.ProblemSolutionFit]: {
41
+ id: LifecycleStage.ProblemSolutionFit,
42
+ order: 1,
43
+ slug: "problem-solution-fit",
44
+ name: "Problem–Solution Fit",
45
+ question: "Do people care enough about this solution?",
46
+ signals: [
47
+ "Prototype reuse",
48
+ "Referral energy",
49
+ "Pre-pay interest"
50
+ ],
51
+ traps: ["“Market is huge” without users", "Skipping qualitative loops"],
52
+ focusAreas: [
53
+ "Solution hypothesis",
54
+ "Value messaging",
55
+ "Feedback capture"
56
+ ]
57
+ },
58
+ [LifecycleStage.MvpEarlyTraction]: {
59
+ id: LifecycleStage.MvpEarlyTraction,
60
+ order: 2,
61
+ slug: "mvp-early-traction",
62
+ name: "MVP & Early Traction",
63
+ question: "Can we get real usage and learn fast?",
64
+ signals: [
65
+ "20–50 named active users",
66
+ "Weekly releases",
67
+ "Noisy feedback"
68
+ ],
69
+ traps: ["Overbuilt infra for 10 users", "Undefined retention metric"],
70
+ focusAreas: [
71
+ "Activation",
72
+ "Cohort tracking",
73
+ "Feedback rituals"
74
+ ]
75
+ },
76
+ [LifecycleStage.ProductMarketFit]: {
77
+ id: LifecycleStage.ProductMarketFit,
78
+ order: 3,
79
+ slug: "product-market-fit",
80
+ name: "Product–Market Fit",
81
+ question: "Is this pulling us forward?",
82
+ signals: [
83
+ "Retention without heroics",
84
+ "Organic word-of-mouth",
85
+ "Value stories"
86
+ ],
87
+ traps: ["Hero growth that does not scale", "Ignoring churn signals"],
88
+ focusAreas: [
89
+ "Retention",
90
+ "Reliability",
91
+ "ICP clarity"
92
+ ]
93
+ },
94
+ [LifecycleStage.GrowthScaleUp]: {
95
+ id: LifecycleStage.GrowthScaleUp,
96
+ order: 4,
97
+ slug: "growth-scale-up",
98
+ name: "Growth / Scale-up",
99
+ question: "Can we grow this repeatably?",
100
+ signals: [
101
+ "Predictable channels",
102
+ "Specialized hires",
103
+ "Unit economics on track"
104
+ ],
105
+ traps: ["Paid spend masking retention gaps", "Infra debt blocking launches"],
106
+ focusAreas: [
107
+ "Ops systems",
108
+ "Growth loops",
109
+ "Reliability engineering"
110
+ ]
111
+ },
112
+ [LifecycleStage.ExpansionPlatform]: {
113
+ id: LifecycleStage.ExpansionPlatform,
114
+ order: 5,
115
+ slug: "expansion-platform",
116
+ name: "Expansion / Platform",
117
+ question: "What is the next growth curve?",
118
+ signals: [
119
+ "Stable core metrics",
120
+ "Partner/API demand",
121
+ "Ecosystem pull"
122
+ ],
123
+ traps: ["Platform theater before wedge is solid"],
124
+ focusAreas: [
125
+ "Partnerships",
126
+ "APIs",
127
+ "New market validation"
128
+ ]
129
+ },
130
+ [LifecycleStage.MaturityRenewal]: {
131
+ id: LifecycleStage.MaturityRenewal,
132
+ order: 6,
133
+ slug: "maturity-renewal",
134
+ name: "Maturity / Renewal",
135
+ question: "Optimize, reinvent, or sunset?",
136
+ signals: [
137
+ "Margin focus",
138
+ "Portfolio bets",
139
+ "Narrative refresh"
140
+ ],
141
+ traps: ["Assuming past success is enough"],
142
+ focusAreas: [
143
+ "Cost optimization",
144
+ "Reinvention bets",
145
+ "Sunset planning"
146
+ ]
147
+ }
148
+ };
149
+
150
+ //#endregion
151
+ export { LIFECYCLE_STAGE_META, LifecycleStage };
@@ -1 +1 @@
1
- import"../types/stages.js";
1
+ import "../types/stages.js";
@@ -1 +1,53 @@
1
- import{e,n as t}from"../libs/lifecycle/dist/types/stages.js";import"../libs/lifecycle/dist/index.js";import"../collectors/signal-collector.js";import"../scoring/stage-scorer.js";var n=class{collector;scorer;planner;constructor(e){this.collector=e.collector,this.scorer=e.scorer,this.planner=e.milestonePlanner}async run(e){let n=await this.collector.collect(e),a=this.scorer.score({metrics:n.metrics,signals:n.signals}),o=a[0]??r(),s=t[o.stage];return{stage:o.stage,confidence:o.confidence,axes:n.axes,signals:n.signals,metrics:i(n.metrics),gaps:s.focusAreas.slice(0,3),focusAreas:s.focusAreas,scorecard:a,generatedAt:new Date().toISOString()}}getUpcomingMilestones(e,t=[],n=5){return this.planner?this.planner.getUpcoming(e,t,n):[]}};const r=()=>({stage:e.Exploration,score:.3,confidence:.3,supportingSignals:[]}),i=e=>Object.entries(e??{}).reduce((e,[t,n])=>(typeof n==`number`&&(e[t]=n),e),{});export{n as LifecycleOrchestrator};
1
+ import { LIFECYCLE_STAGE_META, LifecycleStage } from "../libs/lifecycle/dist/types/stages.js";
2
+ import "../libs/lifecycle/dist/index.js";
3
+ import "../collectors/signal-collector.js";
4
+ import "../scoring/stage-scorer.js";
5
+
6
+ //#region src/orchestrator/lifecycle-orchestrator.ts
7
+ var LifecycleOrchestrator = class {
8
+ collector;
9
+ scorer;
10
+ planner;
11
+ constructor(options) {
12
+ this.collector = options.collector;
13
+ this.scorer = options.scorer;
14
+ this.planner = options.milestonePlanner;
15
+ }
16
+ async run(input) {
17
+ const collected = await this.collector.collect(input);
18
+ const scorecard = this.scorer.score({
19
+ metrics: collected.metrics,
20
+ signals: collected.signals
21
+ });
22
+ const top = scorecard[0] ?? fallbackScore();
23
+ const meta = LIFECYCLE_STAGE_META[top.stage];
24
+ return {
25
+ stage: top.stage,
26
+ confidence: top.confidence,
27
+ axes: collected.axes,
28
+ signals: collected.signals,
29
+ metrics: toMetricRecord(collected.metrics),
30
+ gaps: meta.focusAreas.slice(0, 3),
31
+ focusAreas: meta.focusAreas,
32
+ scorecard,
33
+ generatedAt: (/* @__PURE__ */ new Date()).toISOString()
34
+ };
35
+ }
36
+ getUpcomingMilestones(stage, completedMilestoneIds = [], limit = 5) {
37
+ if (!this.planner) return [];
38
+ return this.planner.getUpcoming(stage, completedMilestoneIds, limit);
39
+ }
40
+ };
41
+ const fallbackScore = () => ({
42
+ stage: LifecycleStage.Exploration,
43
+ score: .3,
44
+ confidence: .3,
45
+ supportingSignals: []
46
+ });
47
+ const toMetricRecord = (snapshot) => Object.entries(snapshot ?? {}).reduce((acc, [key, value]) => {
48
+ if (typeof value === "number") acc[key] = value;
49
+ return acc;
50
+ }, {});
51
+
52
+ //#endregion
53
+ export { LifecycleOrchestrator };
@@ -1 +1,16 @@
1
- import e from"../data/milestones-catalog.js";var t=class{milestones;constructor(t){this.milestones=t??e}getUpcoming(e,t=[],n=5){let r=new Set(t);return this.milestones.filter(t=>t.stage===e&&!r.has(t.id)).sort((e,t)=>e.priority-t.priority).slice(0,n)}};export{t as LifecycleMilestonePlanner};
1
+ import milestones_catalog_default from "../data/milestones-catalog.js";
2
+
3
+ //#region src/planning/milestone-planner.ts
4
+ var LifecycleMilestonePlanner = class {
5
+ milestones;
6
+ constructor(customCatalog) {
7
+ this.milestones = customCatalog ?? milestones_catalog_default;
8
+ }
9
+ getUpcoming(stage, completedIds = [], limit = 5) {
10
+ const completedSet = new Set(completedIds);
11
+ return this.milestones.filter((milestone) => milestone.stage === stage && !completedSet.has(milestone.id)).sort((a, b) => a.priority - b.priority).slice(0, limit);
12
+ }
13
+ };
14
+
15
+ //#endregion
16
+ export { LifecycleMilestonePlanner };
@@ -1 +1,64 @@
1
- import{e,n as t}from"../libs/lifecycle/dist/types/stages.js";import"../libs/lifecycle/dist/index.js";import n from"../data/stage-weights.js";const r=n;var i=class{weights;constructor(e=r){this.weights=e}score(t){let n=s(t.signals);return Object.values(e).filter(c).map(r=>{let i=e[r],s=this.weights[i]??{base:.5},c=s.base??.5,l=0,u=Object.keys(s.metrics??{}).length+Object.keys(s.signalKinds??{}).length||1,d=[];s.metrics&&Object.entries(s.metrics).forEach(([e,n])=>{let r=t.metrics[e];r!=null&&(a(r,n)?(c+=n.weight,l+=1,d.push(`metric:${e}`)):c+=n.weight*.25)}),s.signalKinds&&Object.entries(s.signalKinds).forEach(([e,t])=>{(n[e]??0)>0&&typeof t==`number`&&(c+=t,l+=1,d.push(`signal:${e}`))}),c=o(c,0,1.25);let f=o(l/u,.1,1);return{stage:r,score:c,confidence:f,supportingSignals:d}}).sort((e,t)=>t.score===e.score?t.confidence-e.confidence:t.score-e.score)}};const a=(e,t)=>(t.direction??`gte`)===`gte`?e>=t.threshold:e<=t.threshold,o=(e,t,n)=>Math.min(Math.max(e,t),n),s=e=>e.reduce((e,t)=>{let n=t.kind??`unknown`;return e[n]=(e[n]??0)+(t.weight??1),e},{}),c=e=>typeof e==`number`&&e in t;export{i as StageScorer};
1
+ import { LIFECYCLE_STAGE_META, LifecycleStage } from "../libs/lifecycle/dist/types/stages.js";
2
+ import "../libs/lifecycle/dist/index.js";
3
+ import stage_weights_default from "../data/stage-weights.js";
4
+
5
+ //#region src/scoring/stage-scorer.ts
6
+ const DEFAULT_WEIGHTS = stage_weights_default;
7
+ var StageScorer = class {
8
+ weights;
9
+ constructor(weights = DEFAULT_WEIGHTS) {
10
+ this.weights = weights;
11
+ }
12
+ score(input) {
13
+ const kindStrength = evaluateSignalKinds(input.signals);
14
+ return Object.values(LifecycleStage).filter(isStageValue).map((stage) => {
15
+ const stageName = LifecycleStage[stage];
16
+ const config = this.weights[stageName] ?? { base: .5 };
17
+ let score = config.base ?? .5;
18
+ let contributions = 0;
19
+ const totalPossible = Object.keys(config.metrics ?? {}).length + Object.keys(config.signalKinds ?? {}).length || 1;
20
+ const supportingSignals = [];
21
+ if (config.metrics) Object.entries(config.metrics).forEach(([metricKey, metricConfig]) => {
22
+ const value = input.metrics[metricKey];
23
+ if (value === void 0 || value === null) return;
24
+ if (passesThreshold(value, metricConfig)) {
25
+ score += metricConfig.weight;
26
+ contributions += 1;
27
+ supportingSignals.push(`metric:${metricKey}`);
28
+ } else score += metricConfig.weight * .25;
29
+ });
30
+ if (config.signalKinds) Object.entries(config.signalKinds).forEach(([kind, weight]) => {
31
+ if ((kindStrength[kind] ?? 0) > 0 && typeof weight === "number") {
32
+ score += weight;
33
+ contributions += 1;
34
+ supportingSignals.push(`signal:${kind}`);
35
+ }
36
+ });
37
+ score = clamp(score, 0, 1.25);
38
+ const confidence = clamp(contributions / totalPossible, .1, 1);
39
+ return {
40
+ stage,
41
+ score,
42
+ confidence,
43
+ supportingSignals
44
+ };
45
+ }).sort((a, b) => {
46
+ if (b.score === a.score) return b.confidence - a.confidence;
47
+ return b.score - a.score;
48
+ });
49
+ }
50
+ };
51
+ const passesThreshold = (value, config) => {
52
+ if ((config.direction ?? "gte") === "gte") return value >= config.threshold;
53
+ return value <= config.threshold;
54
+ };
55
+ const clamp = (value, min, max) => Math.min(Math.max(value, min), max);
56
+ const evaluateSignalKinds = (signals) => signals.reduce((acc, signal) => {
57
+ const key = signal.kind ?? "unknown";
58
+ acc[key] = (acc[key] ?? 0) + (signal.weight ?? 1);
59
+ return acc;
60
+ }, {});
61
+ const isStageValue = (value) => typeof value === "number" && value in LIFECYCLE_STAGE_META;
62
+
63
+ //#endregion
64
+ export { StageScorer };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lssm/module.lifecycle-core",
3
- "version": "0.0.0-canary-20251217063201",
3
+ "version": "0.0.0-canary-20251217072406",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -24,11 +24,11 @@
24
24
  "test": "bun run"
25
25
  },
26
26
  "dependencies": {
27
- "@lssm/lib.lifecycle": "0.0.0-canary-20251217063201"
27
+ "@lssm/lib.lifecycle": "0.0.0-canary-20251217072406"
28
28
  },
29
29
  "devDependencies": {
30
- "@lssm/tool.tsdown": "0.0.0-canary-20251217063201",
31
- "@lssm/tool.typescript": "0.0.0-canary-20251217063201",
30
+ "@lssm/tool.tsdown": "0.0.0-canary-20251217072406",
31
+ "@lssm/tool.typescript": "0.0.0-canary-20251217072406",
32
32
  "tsdown": "^0.17.4",
33
33
  "typescript": "^5.9.3"
34
34
  },